Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-01-15 15:24:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-01-15 15:30:31 +0300
commitb8e8c0e325d213f2dcf4adad5506989fa224716e (patch)
treeadb3d7fa8735426ea856a929f562655b2eaf64cb /source
parent4226ee0b71fec6f08897dacf3d6632526618acca (diff)
Cleanup: comment line length (editors)
Prevents clang-format wrapping text before comments.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c9
-rw-r--r--source/blender/editors/animation/anim_channels_edit.c30
-rw-r--r--source/blender/editors/animation/anim_draw.c6
-rw-r--r--source/blender/editors/animation/anim_filter.c31
-rw-r--r--source/blender/editors/animation/anim_markers.c3
-rw-r--r--source/blender/editors/animation/drivers.c3
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c6
-rw-r--r--source/blender/editors/animation/keyframes_draw.c10
-rw-r--r--source/blender/editors/animation/keyframes_edit.c41
-rw-r--r--source/blender/editors/animation/keyframing.c12
-rw-r--r--source/blender/editors/animation/keyingsets.c3
-rw-r--r--source/blender/editors/armature/armature_add.c7
-rw-r--r--source/blender/editors/armature/armature_edit.c2
-rw-r--r--source/blender/editors/armature/armature_relations.c11
-rw-r--r--source/blender/editors/armature/armature_utils.c9
-rw-r--r--source/blender/editors/armature/meshlaplacian.c3
-rw-r--r--source/blender/editors/armature/pose_lib.c17
-rw-r--r--source/blender/editors/armature/pose_select.c3
-rw-r--r--source/blender/editors/armature/pose_slide.c56
-rw-r--r--source/blender/editors/armature/pose_transform.c11
-rw-r--r--source/blender/editors/armature/pose_utils.c3
-rw-r--r--source/blender/editors/curve/editcurve.c36
-rw-r--r--source/blender/editors/curve/editcurve_add.c4
-rw-r--r--source/blender/editors/gpencil/annotate_draw.c27
-rw-r--r--source/blender/editors/gpencil/annotate_paint.c3
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c38
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_convert.c8
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c13
-rw-r--r--source/blender/editors/gpencil/gpencil_fill.c94
-rw-r--r--source/blender/editors/gpencil/gpencil_intern.h174
-rw-r--r--source/blender/editors/gpencil/gpencil_interpolate.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c6
-rw-r--r--source/blender/editors/gpencil/gpencil_select.c3
-rw-r--r--source/blender/editors/gpencil/gpencil_utils.c8
-rw-r--r--source/blender/editors/include/ED_anim_api.h206
-rw-r--r--source/blender/editors/include/ED_armature.h56
-rw-r--r--source/blender/editors/include/ED_fileselect.h6
-rw-r--r--source/blender/editors/include/ED_keyframes_draw.h21
-rw-r--r--source/blender/editors/include/ED_keyframes_edit.h36
-rw-r--r--source/blender/editors/include/ED_keyframing.h31
-rw-r--r--source/blender/editors/include/ED_numinput.h32
-rw-r--r--source/blender/editors/include/ED_object.h9
-rw-r--r--source/blender/editors/include/ED_screen_types.h16
-rw-r--r--source/blender/editors/include/ED_transverts.h9
-rw-r--r--source/blender/editors/include/ED_view3d.h15
-rw-r--r--source/blender/editors/include/UI_interface.h22
-rw-r--r--source/blender/editors/interface/interface.c30
-rw-r--r--source/blender/editors/interface/interface_align.c99
-rw-r--r--source/blender/editors/interface/interface_anim.c3
-rw-r--r--source/blender/editors/interface/interface_context_menu.c15
-rw-r--r--source/blender/editors/interface/interface_draw.c6
-rw-r--r--source/blender/editors/interface/interface_eyedropper_datablock.c3
-rw-r--r--source/blender/editors/interface/interface_handlers.c106
-rw-r--r--source/blender/editors/interface/interface_icons.c23
-rw-r--r--source/blender/editors/interface/interface_intern.h101
-rw-r--r--source/blender/editors/interface/interface_layout.c52
-rw-r--r--source/blender/editors/interface/interface_ops.c12
-rw-r--r--source/blender/editors/interface/interface_panel.c19
-rw-r--r--source/blender/editors/interface/interface_region_color_picker.c6
-rw-r--r--source/blender/editors/interface/interface_region_menu_pie.c3
-rw-r--r--source/blender/editors/interface/interface_region_menu_popup.c6
-rw-r--r--source/blender/editors/interface/interface_region_popover.c3
-rw-r--r--source/blender/editors/interface/interface_region_search.c15
-rw-r--r--source/blender/editors/interface/interface_style.c3
-rw-r--r--source/blender/editors/interface/interface_templates.c59
-rw-r--r--source/blender/editors/interface/interface_utils.c3
-rw-r--r--source/blender/editors/interface/interface_widgets.c37
-rw-r--r--source/blender/editors/interface/resources.c3
-rw-r--r--source/blender/editors/interface/view2d.c55
-rw-r--r--source/blender/editors/interface/view2d_ops.c116
-rw-r--r--source/blender/editors/lattice/editlattice_tools.c3
-rw-r--r--source/blender/editors/mask/mask_draw.c22
-rw-r--r--source/blender/editors/mask/mask_ops.c3
-rw-r--r--source/blender/editors/mesh/editface.c3
-rw-r--r--source/blender/editors/mesh/editmesh_add.c3
-rw-r--r--source/blender/editors/mesh/editmesh_bevel.c6
-rw-r--r--source/blender/editors/mesh/editmesh_inset.c3
-rw-r--r--source/blender/editors/mesh/editmesh_intersect.c15
-rw-r--r--source/blender/editors/mesh/editmesh_knife.c6
-rw-r--r--source/blender/editors/mesh/editmesh_loopcut.c12
-rw-r--r--source/blender/editors/mesh/editmesh_path.c3
-rw-r--r--source/blender/editors/mesh/editmesh_rip.c6
-rw-r--r--source/blender/editors/mesh/editmesh_select.c6
-rw-r--r--source/blender/editors/mesh/editmesh_tools.c50
-rw-r--r--source/blender/editors/mesh/editmesh_utils.c9
-rw-r--r--source/blender/editors/mesh/mesh_mirror.c3
-rw-r--r--source/blender/editors/mesh/meshtools.c18
-rw-r--r--source/blender/editors/object/object_add.c8
-rw-r--r--source/blender/editors/object/object_bake.c24
-rw-r--r--source/blender/editors/object/object_bake_api.c3
-rw-r--r--source/blender/editors/object/object_collection.c3
-rw-r--r--source/blender/editors/object/object_constraint.c9
-rw-r--r--source/blender/editors/object/object_data_transfer.c3
-rw-r--r--source/blender/editors/object/object_edit.c8
-rw-r--r--source/blender/editors/object/object_modifier.c9
-rw-r--r--source/blender/editors/object/object_relations.c32
-rw-r--r--source/blender/editors/object/object_select.c3
-rw-r--r--source/blender/editors/object/object_transform.c12
-rw-r--r--source/blender/editors/object/object_vgroup.c16
-rw-r--r--source/blender/editors/physics/particle_edit.c10
-rw-r--r--source/blender/editors/physics/particle_object.c6
-rw-r--r--source/blender/editors/render/render_internal.c8
-rw-r--r--source/blender/editors/render/render_opengl.c4
-rw-r--r--source/blender/editors/render/render_shading.c6
-rw-r--r--source/blender/editors/screen/screen_context.c6
-rw-r--r--source/blender/editors/screen/screen_ops.c6
-rw-r--r--source/blender/editors/screen/screendump.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_cursor.c14
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c12
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_2d.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c112
-rw-r--r--source/blender/editors/sculpt_paint/paint_mask.c3
-rw-r--r--source/blender/editors/sculpt_paint/paint_stroke.c9
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c27
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c9
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c23
-rw-r--r--source/blender/editors/sculpt_paint/sculpt_uv.c6
-rw-r--r--source/blender/editors/sound/sound_ops.c3
-rw-r--r--source/blender/editors/space_action/action_data.c3
-rw-r--r--source/blender/editors/space_action/action_edit.c38
-rw-r--r--source/blender/editors/space_action/action_select.c31
-rw-r--r--source/blender/editors/space_action/space_action.c12
-rw-r--r--source/blender/editors/space_buttons/buttons_context.c8
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c6
-rw-r--r--source/blender/editors/space_clip/clip_buttons.c24
-rw-r--r--source/blender/editors/space_clip/clip_dopesheet_draw.c3
-rw-r--r--source/blender/editors/space_clip/clip_draw.c3
-rw-r--r--source/blender/editors/space_clip/clip_graph_ops.c3
-rw-r--r--source/blender/editors/space_clip/space_clip.c7
-rw-r--r--source/blender/editors/space_console/console_intern.h3
-rw-r--r--source/blender/editors/space_console/console_ops.c9
-rw-r--r--source/blender/editors/space_file/file_draw.c3
-rw-r--r--source/blender/editors/space_file/file_ops.c34
-rw-r--r--source/blender/editors/space_file/filelist.c96
-rw-r--r--source/blender/editors/space_file/filesel.c3
-rw-r--r--source/blender/editors/space_file/fsmenu.c7
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c34
-rw-r--r--source/blender/editors/space_graph/graph_draw.c41
-rw-r--r--source/blender/editors/space_graph/graph_edit.c24
-rw-r--r--source/blender/editors/space_graph/graph_ops.c13
-rw-r--r--source/blender/editors/space_graph/graph_select.c6
-rw-r--r--source/blender/editors/space_graph/space_graph.c20
-rw-r--r--source/blender/editors/space_image/image_buttons.c3
-rw-r--r--source/blender/editors/space_image/image_ops.c19
-rw-r--r--source/blender/editors/space_image/space_image.c10
-rw-r--r--source/blender/editors/space_info/textview.c9
-rw-r--r--source/blender/editors/space_info/textview.h3
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c3
-rw-r--r--source/blender/editors/space_nla/nla_channels.c12
-rw-r--r--source/blender/editors/space_nla/nla_draw.c21
-rw-r--r--source/blender/editors/space_nla/nla_edit.c48
-rw-r--r--source/blender/editors/space_nla/nla_select.c9
-rw-r--r--source/blender/editors/space_node/drawnode.c20
-rw-r--r--source/blender/editors/space_node/node_draw.c18
-rw-r--r--source/blender/editors/space_node/node_edit.c3
-rw-r--r--source/blender/editors/space_node/node_group.c14
-rw-r--r--source/blender/editors/space_node/node_intern.h3
-rw-r--r--source/blender/editors/space_node/node_relationships.c15
-rw-r--r--source/blender/editors/space_node/node_templates.c3
-rw-r--r--source/blender/editors/space_node/space_node.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c6
-rw-r--r--source/blender/editors/space_outliner/outliner_intern.h3
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c5
-rw-r--r--source/blender/editors/space_outliner/outliner_tree.c3
-rw-r--r--source/blender/editors/space_outliner/outliner_utils.c7
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c31
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c12
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c11
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c3
-rw-r--r--source/blender/editors/space_text/text_autocomplete.c3
-rw-r--r--source/blender/editors/space_text/text_draw.c25
-rw-r--r--source/blender/editors/space_text/text_format.h30
-rw-r--r--source/blender/editors/space_text/text_ops.c12
-rw-r--r--source/blender/editors/space_userpref/space_userpref.c3
-rw-r--r--source/blender/editors/space_view3d/drawobject.c2
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c7
-rw-r--r--source/blender/editors/space_view3d/view3d_camera_control.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c17
-rw-r--r--source/blender/editors/space_view3d/view3d_draw_legacy.c3
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c29
-rw-r--r--source/blender/editors/space_view3d/view3d_fly.c33
-rw-r--r--source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c3
-rw-r--r--source/blender/editors/space_view3d/view3d_project.c7
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c19
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c10
-rw-r--r--source/blender/editors/space_view3d/view3d_utils.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c13
-rw-r--r--source/blender/editors/space_view3d/view3d_walk.c6
-rw-r--r--source/blender/editors/transform/transform.c48
-rw-r--r--source/blender/editors/transform/transform_conversions.c152
-rw-r--r--source/blender/editors/transform/transform_generics.c12
-rw-r--r--source/blender/editors/transform/transform_gizmo_3d.c3
-rw-r--r--source/blender/editors/transform/transform_input.c3
-rw-r--r--source/blender/editors/transform/transform_ops.c6
-rw-r--r--source/blender/editors/transform/transform_snap.c3
-rw-r--r--source/blender/editors/transform/transform_snap_object.c3
-rw-r--r--source/blender/editors/util/ed_util.c6
-rw-r--r--source/blender/editors/util/numinput.c44
-rw-r--r--source/blender/editors/uvedit/uvedit_buttons.c2
-rw-r--r--source/blender/editors/uvedit/uvedit_draw.c3
-rw-r--r--source/blender/editors/uvedit/uvedit_ops.c10
-rw-r--r--source/blender/editors/uvedit/uvedit_parametrizer.c3
-rw-r--r--source/blender/editors/uvedit/uvedit_smart_stitch.c45
-rw-r--r--source/blender/editors/uvedit/uvedit_unwrap_ops.c9
209 files changed, 2545 insertions, 1297 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index e7416b94abf..8f052b4c19a 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -3531,7 +3531,8 @@ static bAnimChannelType ACF_NLAACTION =
"NLA Active Action", /* type name */
ACHANNEL_ROLE_CHANNEL, /* role */
- acf_nlaaction_color, /* backdrop color (NOTE: the backdrop handles this too, since it needs special hacks) */
+ acf_nlaaction_color, /* backdrop color (NOTE: the backdrop handles this too,
+ * since it needs special hacks) */
acf_nlaaction_backdrop, /* backdrop */
acf_generic_indention_flexible, /* indent level */
acf_generic_group_offset, /* offset */ // XXX?
@@ -4413,7 +4414,8 @@ static void draw_setting_widget(bAnimContext *ac, bAnimListElem *ale, const bAni
break;
/* no flushing */
- case ACHANNEL_SETTING_EXPAND: /* expanding - cannot flush, otherwise all would open/close at once */
+ case ACHANNEL_SETTING_EXPAND: /* expanding - cannot flush,
+ * otherwise all would open/close at once */
default:
UI_but_func_set(but, achannel_setting_widget_cb, NULL, NULL);
break;
@@ -4601,7 +4603,8 @@ void ANIM_channel_draw_widgets(const bContext *C, bAnimContext *ac, bAnimListEle
/* modifiers disable */
if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MOD_OFF)) {
- offset += ICON_WIDTH * 1.2f; /* hack: extra spacing, to avoid touching the mute toggle */
+ /* hack: extra spacing, to avoid touching the mute toggle */
+ offset += ICON_WIDTH * 1.2f;
draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax - offset, ymid, ACHANNEL_SETTING_MOD_OFF);
}
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c
index b232c23b0a5..af730036c9f 100644
--- a/source/blender/editors/animation/anim_channels_edit.c
+++ b/source/blender/editors/animation/anim_channels_edit.c
@@ -881,7 +881,8 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands, ListBase *sr
Link *channel, eAnim_ChannelType type,
const bool is_hidden)
{
- tReorderChannelIsland *island = islands->last; /* always try to add to last island if possible */
+ /* always try to add to last island if possible */
+ tReorderChannelIsland *island = islands->last;
bool is_sel = false, is_untouchable = false;
/* get flags - selected and untouchable from the channel */
@@ -1561,7 +1562,8 @@ static void ANIM_OT_channels_group(wmOperatorType *ot)
ot->prop = RNA_def_string(ot->srna, "name", "New Group",
sizeof(((bActionGroup *)NULL)->name),
"Name", "Name of newly created group");
- /* RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE); */ /* XXX: still not too sure about this - keeping same text is confusing... */
+ /* XXX: still not too sure about this - keeping same text is confusing... */
+ // RNA_def_property_flag(ot->prop, PROP_SKIP_SAVE);
}
/* ----------------------------------------------------------- */
@@ -2948,7 +2950,8 @@ static int mouse_anim_channels(bContext *C, bAnimContext *ac, int channel_index,
BKE_gpencil_layer_setactive(gpd, gpl);
}
- WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED | ND_SPACE_PROPERTIES, NULL); /* Grease Pencil updates */
+ /* Grease Pencil updates */
+ WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED | ND_SPACE_PROPERTIES, NULL);
notifierFlags |= (ND_ANIMCHAN | NA_EDITED); /* Animation Editors updates */
break;
}
@@ -3018,17 +3021,24 @@ static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, const wmE
v2d = &ar->v2d;
/* select mode is either replace (deselect all, then add) or add/extend */
- if (RNA_boolean_get(op->ptr, "extend"))
+ if (RNA_boolean_get(op->ptr, "extend")) {
selectmode = SELECT_INVERT;
- else if (RNA_boolean_get(op->ptr, "children_only"))
- selectmode = -1; /* this is a bit of a special case for ActionGroups only... should it be removed or extended to all instead? */
- else
+ }
+ else if (RNA_boolean_get(op->ptr, "children_only")) {
+ /* this is a bit of a special case for ActionGroups only...
+ * should it be removed or extended to all instead? */
+ selectmode = -1;
+ }
+ else {
selectmode = SELECT_REPLACE;
+ }
/* figure out which channel user clicked in
- * Note: although channels technically start at (y = ACHANNEL_FIRST), we need to adjust by half a channel's height
- * so that the tops of channels get caught ok. Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use
- * ACHANNEL_HEIGHT_HALF.
+ *
+ * Note:
+ * although channels technically start at (y = ACHANNEL_FIRST),
+ * we need to adjust by half a channel's height so that the tops of channels get caught ok.
+ * Since ACHANNEL_FIRST is really ACHANNEL_HEIGHT, we simply use ACHANNEL_HEIGHT_HALF.
*/
UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &x, &y);
UI_view2d_listview_view_to_cell(v2d, ACHANNEL_NAMEWIDTH, ACHANNEL_STEP(&ac), 0, (float)ACHANNEL_HEIGHT_HALF(&ac), x, y, NULL, &channel_index);
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c
index 239ab5f8206..27584c5e522 100644
--- a/source/blender/editors/animation/anim_draw.c
+++ b/source/blender/editors/animation/anim_draw.c
@@ -175,7 +175,8 @@ void ANIM_draw_previewrange(const bContext *C, View2D *v2d, int end_frame_width)
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformThemeColorShadeAlpha(TH_ANIM_PREVIEW_RANGE, -25, -30);
- //immUniformColor4f(0.8f, 0.44f, 0.1f, 0.2f); /* XXX: Fix this hardcoded color (anim_active) */
+ /* XXX: Fix this hardcoded color (anim_active) */
+ //immUniformColor4f(0.8f, 0.44f, 0.1f, 0.2f);
/* only draw two separate 'curtains' if there's no overlap between them */
if (PSFRA < PEFRA + end_frame_width) {
@@ -285,7 +286,8 @@ static short bezt_nlamapping_restore(KeyframeEditData *ked, BezTriple *bezt)
return 0;
}
-/* helper function for ANIM_nla_mapping_apply_fcurve() -> "apply", i.e. mapping points to NLA-mapped global time */
+/* helper function for ANIM_nla_mapping_apply_fcurve() -> "apply",
+ * i.e. mapping points to NLA-mapped global time */
static short bezt_nlamapping_apply(KeyframeEditData *ked, BezTriple *bezt)
{
/* AnimData block providing scaling is stored in 'data', only_keys option is stored in i1 */
diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index d066d132529..db887dbfeb1 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -908,7 +908,8 @@ static bAnimListElem *make_new_animlistelem(void *data, short datatype, ID *owne
break;
}
case ANIMTYPE_FCURVE:
- case ANIMTYPE_NLACURVE: /* practically the same as ANIMTYPE_FCURVE. Differences are applied post-creation */
+ case ANIMTYPE_NLACURVE: /* practically the same as ANIMTYPE_FCURVE.
+ * Differences are applied post-creation */
{
FCurve *fcu = (FCurve *)data;
@@ -1001,7 +1002,8 @@ static bool skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id
if (fcu->grp != NULL && fcu->grp->flag & ADT_CURVES_ALWAYS_VISIBLE) {
return false;
}
- /* hidden items should be skipped if we only care about visible data, but we aren't interested in hidden stuff */
+ /* hidden items should be skipped if we only care about visible data,
+ * but we aren't interested in hidden stuff */
const bool skip_hidden = (filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN);
if (GS(owner_id->name) == ID_OB) {
@@ -1266,7 +1268,8 @@ static size_t animfilter_fcurves(ListBase *anim_data, bDopeSheet *ads,
*/
for (fcu = first; ( (fcu = animfilter_fcurve_next(ads, fcu, fcurve_type, filter_mode, owner, owner_id)) ); fcu = fcu->next) {
if (UNLIKELY(fcurve_type == ANIMTYPE_NLACURVE)) {
- /* NLA Control Curve - Basically the same as normal F-Curves, except we need to set some stuff differently */
+ /* NLA Control Curve - Basically the same as normal F-Curves,
+ * except we need to set some stuff differently */
ANIMCHANNEL_NEW_CHANNEL_FULL(fcu, ANIMTYPE_NLACURVE, owner_id, fcurve_owner_id, {
ale->owner = owner; /* strip */
ale->adt = NULL; /* to prevent time mapping from causing problems */
@@ -1295,8 +1298,11 @@ static size_t animfilter_act_group(bAnimContext *ac, ListBase *anim_data, bDopeS
* - Hierarchy matters: this hack should be applied
* - Hierarchy ignored: cases like [#21276] won't work properly, unless we skip this hack
*/
- if ( ((filter_mode & ANIMFILTER_LIST_VISIBLE) && EXPANDED_AGRP(ac, agrp) == 0) && /* care about hierarchy but group isn't expanded */
- (filter_mode & (ANIMFILTER_SEL | ANIMFILTER_UNSEL)) ) /* care about selection status */
+ if (
+ /* care about hierarchy but group isn't expanded */
+ ((filter_mode & ANIMFILTER_LIST_VISIBLE) && EXPANDED_AGRP(ac, agrp) == 0) &&
+ /* care about selection status */
+ (filter_mode & (ANIMFILTER_SEL | ANIMFILTER_UNSEL)) )
{
/* if the group itself isn't selected appropriately, we shouldn't consider it's children either */
if (ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) == 0)
@@ -1318,9 +1324,9 @@ static size_t animfilter_act_group(bAnimContext *ac, ListBase *anim_data, bDopeS
{
/* special filter so that we can get just the F-Curves within the active group */
if (!(filter_mode & ANIMFILTER_ACTGROUPED) || (agrp->flag & AGRP_ACTIVE)) {
- /* for the Graph Editor, curves may be set to not be visible in the view to lessen clutter,
- * but to do this, we need to check that the group doesn't have it's not-visible flag set preventing
- * all its sub-curves to be shown
+ /* for the Graph Editor, curves may be set to not be visible in the view to lessen
+ * clutter, but to do this, we need to check that the group doesn't have it's
+ * not-visible flag set preventing all its sub-curves to be shown
*/
if (!(filter_mode & ANIMFILTER_CURVE_VISIBLE) || !(agrp->flag & AGRP_NOTVISIBLE)) {
/* group must be editable for its children to be editable (if we care about this) */
@@ -1343,7 +1349,8 @@ static size_t animfilter_act_group(bAnimContext *ac, ListBase *anim_data, bDopeS
/* restore original filter mode so that this next step works ok... */
//filter_mode = ofilter;
- /* filter selection of channel specially here again, since may be open and not subject to previous test */
+ /* filter selection of channel specially here again,
+ * since may be open and not subject to previous test */
if (ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) ) {
ANIMCHANNEL_NEW_CHANNEL(agrp, ANIMTYPE_GROUP, owner_id, NULL);
}
@@ -1759,7 +1766,8 @@ static size_t animdata_filter_gpencil(bAnimContext *ac, ListBase *anim_data, voi
else {
bGPdata *gpd;
- /* Grab all Grease Pencil datablocks directly from main, but only those that seem to be useful somewhere */
+ /* Grab all Grease Pencil datablocks directly from main,
+ * but only those that seem to be useful somewhere */
for (gpd = ac->bmain->gpencil.first; gpd; gpd = gpd->id.next) {
/* only show if gpd is used by something... */
if (ID_REAL_USERS(gpd) < 1)
@@ -3260,7 +3268,8 @@ size_t ANIM_animdata_filter(bAnimContext *ac, ListBase *anim_data, eAnimFilter_F
case ANIMCONT_DRIVERS: /* Graph Editor -> Drivers Editing */
case ANIMCONT_NLA: /* NLA Editor */
{
- /* all of these editors use the basic DopeSheet data for filtering options, but don't have all the same features */
+ /* all of these editors use the basic DopeSheet data for filtering options,
+ * but don't have all the same features */
items = animdata_filter_dopesheet(ac, anim_data, data, filter_mode);
break;
}
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 74169128e5a..6b687041324 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -616,7 +616,8 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, const wm
BKE_report(op->reports, RPT_ERROR, "Programming error: operator does not actually have code to do anything!");
- /* unless successful, must add "pass-through" to let normal operator's have a chance at tackling this event */
+ /* unless successful, must add "pass-through"
+ * to let normal operator's have a chance at tackling this event */
if ((retval & (OPERATOR_FINISHED | OPERATOR_INTERFACE)) == 0) {
retval |= OPERATOR_PASS_THROUGH;
}
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index ac57f77bac9..85662ee499d 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -329,7 +329,8 @@ int ANIM_add_driver_with_target(
/* handle curve-property mappings based on mapping_type */
switch (mapping_type) {
- case CREATEDRIVER_MAPPING_N_N: /* N-N - Try to match as much as possible, then use the first one */
+ case CREATEDRIVER_MAPPING_N_N: /* N-N - Try to match as much as possible,
+ * then use the first one */
{
/* Use the shorter of the two (to avoid out of bounds access) */
int dst_len = (RNA_property_array_check(prop)) ? RNA_property_array_length(&ptr, prop) : 1;
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 87c9d9c09c0..a588c80936a 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -358,9 +358,11 @@ static void fmod_envelope_addpoint_cb(bContext *C, void *fcm_dv, void *UNUSED(ar
bool exists;
int i = BKE_fcm_envelope_find_index(env->data, (float)(scene->r.cfra), env->totvert, &exists);
- /* binarysearch_...() will set exists by default to 0, so if it is non-zero, that means that the point exists already */
- if (exists)
+ /* binarysearch_...() will set exists by default to 0,
+ * so if it is non-zero, that means that the point exists already */
+ if (exists) {
return;
+ }
/* add new */
fedn = MEM_callocN((env->totvert + 1) * sizeof(FCM_EnvelopeData), "FCM_EnvelopeData");
diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c
index 72da71a8a0e..9fe4bc9fd21 100644
--- a/source/blender/editors/animation/keyframes_draw.c
+++ b/source/blender/editors/animation/keyframes_draw.c
@@ -557,7 +557,8 @@ void draw_keyframe_shape(float x, float y, float size, bool sel, short key_type,
size *= 0.85f;
break;
- case BEZT_KEYTYPE_MOVEHOLD: /* slightly smaller than normal keyframes (but by less than for breakdowns) */
+ case BEZT_KEYTYPE_MOVEHOLD: /* slightly smaller than normal keyframes
+ * (but by less than for breakdowns) */
size *= 0.925f;
break;
@@ -942,9 +943,10 @@ void summary_to_keylist(bAnimContext *ac, DLRBT_Tree *keys, int saction_flag)
/* loop through each F-Curve, grabbing the keyframes */
for (ale = anim_data.first; ale; ale = ale->next) {
/* Why not use all #eAnim_KeyType here?
- * All of the other key types are actually "summaries" themselves, and will just end up duplicating stuff
- * that comes up through standard filtering of just F-Curves.
- * Given the way that these work, there isn't really any benefit at all from including them. - Aligorith */
+ * All of the other key types are actually "summaries" themselves,
+ * and will just end up duplicating stuff that comes up through
+ * standard filtering of just F-Curves. Given the way that these work,
+ * there isn't really any benefit at all from including them. - Aligorith */
switch (ale->datatype) {
case ALE_FCURVE:
diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c
index e733bb0f8b7..f85335ab0e3 100644
--- a/source/blender/editors/animation/keyframes_edit.c
+++ b/source/blender/editors/animation/keyframes_edit.c
@@ -369,7 +369,8 @@ short ANIM_animchannel_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, bA
return 0;
}
-/* This function is used to apply operation to all keyframes, regardless of the type without needed an AnimListElem wrapper */
+/* This function is used to apply operation to all keyframes,
+ * regardless of the type without needed an AnimListElem wrapper */
short ANIM_animchanneldata_keyframes_loop(KeyframeEditData *ked, bDopeSheet *ads, void *data, int keytype, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb)
{
/* sanity checks */
@@ -670,25 +671,35 @@ KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
{
/* eEditKeyframes_Validate */
switch (mode) {
- case BEZT_OK_FRAME: /* only if bezt falls on the right frame (float) */
+ case BEZT_OK_FRAME:
+ /* only if bezt falls on the right frame (float) */
return ok_bezier_frame;
- case BEZT_OK_FRAMERANGE: /* only if bezt falls within the specified frame range (floats) */
+ case BEZT_OK_FRAMERANGE:
+ /* only if bezt falls within the specified frame range (floats) */
return ok_bezier_framerange;
- case BEZT_OK_SELECTED: /* only if bezt is selected (self) */
+ case BEZT_OK_SELECTED:
+ /* only if bezt is selected (self) */
return ok_bezier_selected;
- case BEZT_OK_VALUE: /* only if bezt value matches (float) */
+ case BEZT_OK_VALUE:
+ /* only if bezt value matches (float) */
return ok_bezier_value;
- case BEZT_OK_VALUERANGE: /* only if bezier falls within the specified value range (floats) */
+ case BEZT_OK_VALUERANGE:
+ /* only if bezier falls within the specified value range (floats) */
return ok_bezier_valuerange;
- case BEZT_OK_REGION: /* only if bezier falls within the specified rect (data -> rectf) */
+ case BEZT_OK_REGION:
+ /* only if bezier falls within the specified rect (data -> rectf) */
return ok_bezier_region;
- case BEZT_OK_REGION_LASSO: /* only if the point falls within KeyframeEdit_LassoData defined data */
+ case BEZT_OK_REGION_LASSO:
+ /* only if the point falls within KeyframeEdit_LassoData defined data */
return ok_bezier_region_lasso;
- case BEZT_OK_REGION_CIRCLE: /* only if the point falls within KeyframeEdit_CircleData defined data */
+ case BEZT_OK_REGION_CIRCLE:
+ /* only if the point falls within KeyframeEdit_CircleData defined data */
return ok_bezier_region_circle;
- case BEZT_OK_CHANNEL_LASSO: /* same as BEZT_OK_REGION_LASSO, but we're only using the x-value of the points */
+ case BEZT_OK_CHANNEL_LASSO:
+ /* same as BEZT_OK_REGION_LASSO, but we're only using the x-value of the points */
return ok_bezier_channel_lasso;
- case BEZT_OK_CHANNEL_CIRCLE: /* same as BEZT_OK_REGION_CIRCLE, but we're only using the x-value of the points */
+ case BEZT_OK_CHANNEL_CIRCLE:
+ /* same as BEZT_OK_REGION_CIRCLE, but we're only using the x-value of the points */
return ok_bezier_channel_circle;
default: /* nothing was ok */
return NULL;
@@ -698,7 +709,10 @@ KeyframeEditFunc ANIM_editkeyframes_ok(short mode)
/* ******************************************* */
/* Assorted Utility Functions */
-/* helper callback for <animeditor>_cfrasnap_exec() -> used to help get the average time of all selected beztriples */
+/**
+ * Helper callback for <animeditor>_cfrasnap_exec() ->
+ * used to help get the average time of all selected beztriples
+ */
short bezt_calc_average(KeyframeEditData *ked, BezTriple *bezt)
{
/* only if selected */
@@ -718,7 +732,8 @@ short bezt_calc_average(KeyframeEditData *ked, BezTriple *bezt)
return 0;
}
-/* helper callback for columnselect_<animeditor>_keys() -> populate list CfraElems with frame numbers from selected beztriples */
+/* helper callback for columnselect_<animeditor>_keys() -> populate
+ * list CfraElems with frame numbers from selected beztriples */
short bezt_to_cfraelem(KeyframeEditData *ked, BezTriple *bezt)
{
/* only if selected */
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 84d911681b3..d10147fb363 100644
--- a/source/blender/editors/animation/keyframing.c
+++ b/source/blender/editors/animation/keyframing.c
@@ -512,11 +512,15 @@ int insert_vert_fcurve(FCurve *fcu, float x, float y, eBezTriple_KeyframeType ke
* to these later, we want these to work in a sane way out of
* the box.
*/
- beztr.back = 1.70158f; /* "back" easing - this value used to be used when overshoot=0, but that */
- /* introduced discontinuities in how the param worked */
- beztr.amplitude = 0.8f; /* "elastic" easing - values here were hand-optimised for a default duration of */
- beztr.period = 4.1f; /* ~10 frames (typical mograph motion length) */
+ /* "back" easing - this value used to be used when overshoot=0, but that
+ * introduced discontinuities in how the param worked. */
+ beztr.back = 1.70158f;
+
+ /* "elastic" easing - values here were hand-optimised for a default duration of
+ * ~10 frames (typical mograph motion length) */
+ beztr.amplitude = 0.8f;
+ beztr.period = 4.1f;
/* add temp beztriple to keyframes */
a = insert_bezt_fcurve(fcu, &beztr, flag);
diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c
index d980e4322dd..83f454c7f0b 100644
--- a/source/blender/editors/animation/keyingsets.c
+++ b/source/blender/editors/animation/keyingsets.c
@@ -1026,7 +1026,8 @@ int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSe
RNA_id_pointer_create(ksp->id, &id_ptr);
if (RNA_path_resolve_property(&id_ptr, ksp->rna_path, &ptr, &prop)) {
arraylen = RNA_property_array_length(&ptr, prop);
- i = 0; /* start from start of array, instead of the previously specified index - T48020 */
+ /* start from start of array, instead of the previously specified index - T48020 */
+ i = 0;
}
}
diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c
index fb0766d3bed..aa95530d1a6 100644
--- a/source/blender/editors/armature/armature_add.c
+++ b/source/blender/editors/armature/armature_add.c
@@ -491,7 +491,9 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op)
Object **objects = BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, CTX_wm_view3d(C), &objects_len);
for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
EditBone *ebone_iter;
- EditBone *ebone_first_dupe = NULL; /* The beginning of the duplicated bones in the edbo list */
+ /* The beginning of the duplicated bones in the edbo list */
+ EditBone *ebone_first_dupe = NULL;
+
Object *ob = objects[ob_index];
bArmature *arm = ob->data;
@@ -664,7 +666,8 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op)
bArmature *arm = obedit->data;
EditBone *ebone_iter;
- EditBone *ebone_first_dupe = NULL; /* The beginning of the duplicated mirrored bones in the edbo list */
+ /* The beginning of the duplicated mirrored bones in the edbo list */
+ EditBone *ebone_first_dupe = NULL;
ED_armature_edit_sync_selection(arm->edbo); // XXX why is this needed?
diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c
index 7aa6b578475..c262cbdd556 100644
--- a/source/blender/editors/armature/armature_edit.c
+++ b/source/blender/editors/armature/armature_edit.c
@@ -87,7 +87,7 @@ void ED_armature_transform_apply(Main *bmain, Object *ob, float mat[4][4], const
void ED_armature_transform_bones(struct bArmature *arm, float mat[4][4], const bool do_props)
{
EditBone *ebone;
- float scale = mat4_to_scale(mat); /* store the scale of the matrix here to use on envelopes */
+ float scale = mat4_to_scale(mat); /* store the scale of the matrix here to use on envelopes */
float mat3[3][3];
copy_m3_m4(mat3, mat);
diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c
index aadb805feda..e48c2df74e5 100644
--- a/source/blender/editors/armature/armature_relations.c
+++ b/source/blender/editors/armature/armature_relations.c
@@ -144,7 +144,8 @@ static void joined_armature_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data
const char *old_name = BLI_ghashIterator_getKey(&gh_iter);
const char *new_name = BLI_ghashIterator_getValue(&gh_iter);
- /* only remap if changed; this still means there will be some waste if there aren't many drivers/keys */
+ /* only remap if changed; this still means there will be some
+ * waste if there aren't many drivers/keys */
if (!STREQ(old_name, new_name) && strstr(fcu->rna_path, old_name)) {
fcu->rna_path = BKE_animsys_fix_rna_path_rename(id, fcu->rna_path, "pose.bones",
old_name, new_name, 0, 0, false);
@@ -542,7 +543,8 @@ static void separate_armature_bones(Main *bmain, Object *ob, short sel)
for (ebo = arm->edbo->first; ebo; ebo = ebo->next) {
if (ebo->parent == curbone) {
ebo->parent = NULL;
- ebo->temp.p = NULL; /* this is needed to prevent random crashes with in ED_armature_from_edit */
+ /* this is needed to prevent random crashes with in ED_armature_from_edit */
+ ebo->temp.p = NULL;
ebo->flag &= ~BONE_CONNECTED;
}
}
@@ -623,7 +625,10 @@ static int separate_armature_exec(bContext *C, wmOperator *op)
ED_armature_edit_free(obedit->data);
/* 2) duplicate base */
- newbase = ED_object_add_duplicate(bmain, scene, view_layer, oldbase, USER_DUP_ARM); /* only duplicate linked armature */
+
+ /* only duplicate linked armature */
+ newbase = ED_object_add_duplicate(bmain, scene, view_layer, oldbase, USER_DUP_ARM);
+
DEG_relations_tag_update(bmain);
newob = newbase->object;
diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c
index 275d00ded58..6409d544825 100644
--- a/source/blender/editors/armature/armature_utils.c
+++ b/source/blender/editors/armature/armature_utils.c
@@ -672,7 +672,9 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
if (eBone == arm->act_edbone) {
/* don't change active selection, this messes up separate which uses
* editmode toggle and can separate active bone which is de-selected originally */
- /* newBone->flag |= BONE_SELECTED; */ /* important, editbones can be active with only 1 point selected */
+
+ /* important, editbones can be active with only 1 point selected */
+ /* newBone->flag |= BONE_SELECTED; */
arm->act_bone = newBone;
}
newBone->roll = 0.0f;
@@ -707,8 +709,9 @@ void ED_armature_from_edit(Main *bmain, bArmature *arm)
}
/* Fix parenting in a separate pass to ensure ebone->bone connections are valid at this point.
- * Do not set bone->head/tail here anymore, using EditBone data for that is not OK since our later fiddling
- * with parent's arm_mat (for roll conversion) may have some small but visible impact on locations (T46010). */
+ * Do not set bone->head/tail here anymore,
+ * using EditBone data for that is not OK since our later fiddling with parent's arm_mat
+ * (for roll conversion) may have some small but visible impact on locations (T46010). */
for (eBone = arm->edbo->first; eBone; eBone = eBone->next) {
newBone = eBone->temp.bone;
if (eBone->parent) {
diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c
index 96799304845..b427843085a 100644
--- a/source/blender/editors/armature/meshlaplacian.c
+++ b/source/blender/editors/armature/meshlaplacian.c
@@ -1466,7 +1466,8 @@ static void harmonic_coordinates_bind(MeshDeformModifierData *mmd, MeshDeformBin
mdb->cagemesh_cache.mpoly = me->mpoly;
mdb->cagemesh_cache.mloop = me->mloop;
mdb->cagemesh_cache.looptri = BKE_mesh_runtime_looptri_ensure(me);
- mdb->cagemesh_cache.poly_nors = CustomData_get_layer(&me->pdata, CD_NORMAL); /* can be NULL */
+ /* can be NULL */
+ mdb->cagemesh_cache.poly_nors = CustomData_get_layer(&me->pdata, CD_NORMAL);
}
/* make bounding box equal size in all directions, add padding, and compute
diff --git a/source/blender/editors/armature/pose_lib.c b/source/blender/editors/armature/pose_lib.c
index c8ce0774208..30f0b82396a 100644
--- a/source/blender/editors/armature/pose_lib.c
+++ b/source/blender/editors/armature/pose_lib.c
@@ -498,7 +498,10 @@ static int poselib_add_exec(bContext *C, wmOperator *op)
BLI_uniquename(&act->markers, marker, DATA_("Pose"), '.', offsetof(TimeMarker, name), sizeof(marker->name));
/* use Keying Set to determine what to store for the pose */
- ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_WHOLE_CHARACTER_SELECTED_ID); /* this includes custom props :)*/
+
+ /* this includes custom props :)*/
+ ks = ANIM_builtin_keyingset_get_named(NULL, ANIM_KS_WHOLE_CHARACTER_SELECTED_ID);
+
ANIM_apply_keyingset(C, NULL, act, ks, MODIFYKEY_MODE_INSERT, (float)frame);
/* store new 'active' pose number */
@@ -730,7 +733,8 @@ void POSELIB_OT_pose_rename(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
/* properties */
- /* NOTE: name not pose is the operator's "main" property, so that it will get activated in the popup for easy renaming */
+ /* NOTE: name not pose is the operator's "main" property,
+ * so that it will get activated in the popup for easy renaming */
ot->prop = RNA_def_string(ot->srna, "name", "RenamedPose", 64, "New Pose Name", "New name for pose");
prop = RNA_def_enum(ot->srna, "pose", DummyRNA_NULL_items, 0, "Pose", "The pose to rename");
RNA_def_enum_funcs(prop, poselib_stored_pose_itemf);
@@ -963,7 +967,8 @@ static void poselib_backup_restore(tPoseLib_PreviewData *pld)
if (plb->oldprops)
IDP_SyncGroupValues(plb->pchan->prop, plb->oldprops);
- /* TODO: constraints settings aren't restored yet, even though these could change (though not that likely) */
+ /* TODO: constraints settings aren't restored yet,
+ * even though these could change (though not that likely) */
}
}
@@ -1785,7 +1790,11 @@ void POSELIB_OT_browse_interactive(wmOperatorType *ot)
// XXX: percentage vs factor?
/* not used yet */
- /* RNA_def_float_factor(ot->srna, "blend_factor", 1.0f, 0.0f, 1.0f, "Blend Factor", "Amount that the pose is applied on top of the existing poses", 0.0f, 1.0f); */
+#if 0
+ RNA_def_float_factor(
+ ot->srna, "blend_factor", 1.0f, 0.0f, 1.0f, "Blend Factor",
+ "Amount that the pose is applied on top of the existing poses", 0.0f, 1.0f);
+#endif
}
void POSELIB_OT_apply_pose(wmOperatorType *ot)
diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c
index 184c09f5b10..1916495465c 100644
--- a/source/blender/editors/armature/pose_select.c
+++ b/source/blender/editors/armature/pose_select.c
@@ -239,7 +239,8 @@ bool ED_armature_pose_select_pick_with_buffer(
}
/* 'select_mode' is usual SEL_SELECT/SEL_DESELECT/SEL_TOGGLE/SEL_INVERT.
- * When true, 'ignore_visibility' makes this func also affect invisible bones (hidden or on hidden layers). */
+ * When true, 'ignore_visibility' makes this func also affect invisible bones
+ * (hidden or on hidden layers). */
bool ED_pose_deselect_all(Object *ob, int select_mode, const bool ignore_visibility)
{
bArmature *arm = ob->data;
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index 52e580a94af..7ba22fca2f6 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -87,28 +87,43 @@
/* Temporary data shared between these operators */
typedef struct tPoseSlideOp {
- Scene *scene; /* current scene */
- ScrArea *sa; /* area that we're operating in (needed for modal()) */
- ARegion *ar; /* region that we're operating in (needed for modal()) */
- uint objects_len; /* len of the PoseSlideObject array. */
-
- ListBase pfLinks; /* links between posechannels and f-curves for all the pose objects. */
- DLRBT_Tree keys; /* binary tree for quicker searching for keyframes (when applicable) */
+ /** current scene */
+ Scene *scene;
+ /** area that we're operating in (needed for modal()) */
+ ScrArea *sa;
+ /** region that we're operating in (needed for modal()) */
+ ARegion *ar;
+ /** len of the PoseSlideObject array. */
+ uint objects_len;
+
+ /** links between posechannels and f-curves for all the pose objects. */
+ ListBase pfLinks;
+ /** binary tree for quicker searching for keyframes (when applicable) */
+ DLRBT_Tree keys;
- int cframe; /* current frame number - global time */
+ /** current frame number - global time */
+ int cframe;
- int prevFrame; /* frame before current frame (blend-from) - global time */
- int nextFrame; /* frame after current frame (blend-to) - global time */
+ /** frame before current frame (blend-from) - global time */
+ int prevFrame;
+ /** frame after current frame (blend-to) - global time */
+ int nextFrame;
- short mode; /* sliding mode (ePoseSlide_Modes) */
- short flag; /* unused for now, but can later get used for storing runtime settings.... */
+ /** sliding mode (ePoseSlide_Modes) */
+ short mode;
+ /** unused for now, but can later get used for storing runtime settings.... */
+ short flag;
- short channels; /* which transforms/channels are affected (ePoseSlide_Channels) */
- short axislock; /* axis-limits for transforms (ePoseSlide_AxisLock) */
+ /** which transforms/channels are affected (ePoseSlide_Channels) */
+ short channels;
+ /** axis-limits for transforms (ePoseSlide_AxisLock) */
+ short axislock;
- float percentage; /* 0-1 value for determining the influence of whatever is relevant */
+ /** 0-1 value for determining the influence of whatever is relevant */
+ float percentage;
- NumInput num; /* numeric input */
+ /** numeric input */
+ NumInput num;
struct tPoseSlideObject *ob_data_array;
} tPoseSlideOp;
@@ -361,7 +376,8 @@ static void pose_slide_apply_val(
* - numerator should be larger than denominator to 'expand' the result
* - perform this weighting a number of times given by the percentage...
*/
- int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */
+ /* TODO: maybe a sensitivity ctrl on top of this is needed */
+ int iters = (int)ceil(10.0f * pso->percentage);
while (iters-- > 0) {
(*val) = (-((sVal * w2) + (eVal * w1)) + ((*val) * 6.0f) ) / 5.0f;
@@ -374,7 +390,8 @@ static void pose_slide_apply_val(
* - numerator should be smaller than denominator to 'relax' the result
* - perform this weighting a number of times given by the percentage...
*/
- int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */
+ /* TODO: maybe a sensitivity ctrl on top of this is needed */
+ int iters = (int)ceil(10.0f * pso->percentage);
while (iters-- > 0) {
(*val) = ( ((sVal * w2) + (eVal * w1)) + ((*val) * 5.0f) ) / 6.0f;
@@ -579,7 +596,8 @@ static void pose_slide_apply_quat(tPoseSlideOp *pso, tPChanFCurveLink *pfl)
}
else {
float quat_interp[4], quat_orig[4];
- int iters = (int)ceil(10.0f * pso->percentage); /* TODO: maybe a sensitivity ctrl on top of this is needed */
+ /* TODO: maybe a sensitivity ctrl on top of this is needed */
+ int iters = (int)ceil(10.0f * pso->percentage);
/* perform this blending several times until a satisfactory result is reached */
while (iters-- > 0) {
diff --git a/source/blender/editors/armature/pose_transform.c b/source/blender/editors/armature/pose_transform.c
index ffbe8b52137..ad4853256e4 100644
--- a/source/blender/editors/armature/pose_transform.c
+++ b/source/blender/editors/armature/pose_transform.c
@@ -72,7 +72,8 @@
/* ********************************************** */
/* Pose Apply */
-/* helper for apply_armature_pose2bones - fixes parenting of objects that are bone-parented to armature */
+/* helper for apply_armature_pose2bones - fixes parenting of objects
+ * that are bone-parented to armature */
static void applyarmature_fix_boneparents(const bContext *C, Scene *scene, Object *armob)
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
@@ -100,7 +101,8 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *scene = CTX_data_scene(C);
- Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C)); // must be active object, not edit-object
+ // must be active object, not edit-object
+ Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
const Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
bArmature *arm = BKE_armature_from_object(ob);
bPose *pose;
@@ -111,7 +113,7 @@ static int apply_armature_pose2bones_exec(bContext *C, wmOperator *op)
if (ob->type != OB_ARMATURE)
return OPERATOR_CANCELLED;
if (BKE_object_obdata_is_libdata(ob)) {
- BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature"); /* error_libdata(); */
+ BKE_report(op->reports, RPT_ERROR, "Cannot apply pose to lib-linked armature");
return OPERATOR_CANCELLED;
}
@@ -745,7 +747,8 @@ static void pchan_clear_rot(bPoseChannel *pchan)
}
}
- /* Clear also Bendy Bone stuff - Roll is obvious, but Curve X/Y stuff is also kindof rotational in nature... */
+ /* Clear also Bendy Bone stuff - Roll is obvious,
+ * but Curve X/Y stuff is also kindof rotational in nature... */
pchan->roll1 = 0.0f;
pchan->roll2 = 0.0f;
diff --git a/source/blender/editors/armature/pose_utils.c b/source/blender/editors/armature/pose_utils.c
index 051940d69ec..90208c40a30 100644
--- a/source/blender/editors/armature/pose_utils.c
+++ b/source/blender/editors/armature/pose_utils.c
@@ -244,7 +244,8 @@ void poseAnim_mapping_refresh(bContext *C, Scene *scene, Object *ob)
else
BKE_pose_where_is(depsgraph, scene, ob);
- DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE); /* otherwise animation doesn't get updated */
+ /* otherwise animation doesn't get updated */
+ DEG_id_tag_update(&ob->id, ID_RECALC_COPY_ON_WRITE);
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
}
diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c
index 84f8f17d4ee..df9527e6fae 100644
--- a/source/blender/editors/curve/editcurve.c
+++ b/source/blender/editors/curve/editcurve.c
@@ -160,8 +160,9 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
pt_index = 0;
while (a--) {
/* We cannot keep *any* reference to curve obdata,
- * it might be replaced and freed while editcurve remain in use (in viewport render case e.g.).
- * Note that we could use a pool to avoid lots of malloc's here, but... not really a problem for now. */
+ * it might be replaced and freed while editcurve remain in use
+ * (in viewport render case e.g.). Note that we could use a pool to avoid
+ * lots of malloc's here, but... not really a problem for now. */
BezTriple *origbezt_cpy = MEM_mallocN(sizeof(*origbezt), __func__);
*origbezt_cpy = *origbezt;
keyIndex = init_cvKeyIndex(origbezt_cpy, key_index, nu_index, pt_index, vertex_index);
@@ -180,8 +181,9 @@ static void init_editNurb_keyIndex(EditNurb *editnurb, ListBase *origBase)
pt_index = 0;
while (a--) {
/* We cannot keep *any* reference to curve obdata,
- * it might be replaced and freed while editcurve remain in use (in viewport render case e.g.).
- * Note that we could use a pool to avoid lots of malloc's here, but... not really a problem for now. */
+ * it might be replaced and freed while editcurve remain in use
+ * (in viewport render case e.g.). Note that we could use a pool to avoid
+ * lots of malloc's here, but... not really a problem for now. */
BPoint *origbp_cpy = MEM_mallocN(sizeof(*origbp_cpy), __func__);
*origbp_cpy = *origbp;
keyIndex = init_cvKeyIndex(origbp_cpy, key_index, nu_index, pt_index, vertex_index);
@@ -1272,8 +1274,9 @@ void ED_curve_editnurb_make(Object *obedit)
if (actkey) {
editnurb->shapenr = obedit->shapenr;
- /* Apply shapekey to new nurbs of editnurb, not those of original curve (and *after* we generated keyIndex),
- * else we do not have valid 'original' data to properly restore curve when leaving editmode. */
+ /* Apply shapekey to new nurbs of editnurb, not those of original curve
+ * (and *after* we generated keyIndex), else we do not have valid 'original' data
+ * to properly restore curve when leaving editmode. */
BKE_keyblock_convert_to_curve(actkey, cu, &editnurb->nurbs);
}
}
@@ -1336,7 +1339,8 @@ static int separate_exec(bContext *C, wmOperator *op)
}
/* 2. Duplicate the object and data. */
- newbase = ED_object_add_duplicate(bmain, scene, view_layer, oldbase, 0); /* 0 = fully linked. */
+ newbase = ED_object_add_duplicate(
+ bmain, scene, view_layer, oldbase, 0); /* 0 = fully linked. */
DEG_relations_tag_update(bmain);
newob = newbase->object;
@@ -2225,7 +2229,8 @@ static void adduplicateflagNurb(Object *obedit, View3D *v3d, ListBase *newnurb,
newu++;
for (c = a / nu->pntsu, bp3 = bp2; c < nu->pntsv; c++, bp3 += nu->pntsu) {
if (bp3->f1 & flag) {
- bp3->f1 |= SURF_SEEN; /* flag as seen so skipped on future iterations */
+ /* flag as seen so skipped on future iterations */
+ bp3->f1 |= SURF_SEEN;
if (newu == 1) newv++;
}
else {
@@ -2722,7 +2727,8 @@ static void curve_smooth_value(ListBase *editnurb,
for (last_sel = 0; last_sel < nu->pntsu; last_sel++) {
/* loop over selection segments of a curve, smooth each */
- /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
+ /* Start BezTriple code,
+ * this is duplicated below for points, make sure these functions stay in sync */
start_sel = -1;
for (bezt = &nu->bezt[last_sel], a = last_sel; a < nu->pntsu; a++, bezt++) {
if (bezt->f2 & SELECT) {
@@ -2792,7 +2798,8 @@ static void curve_smooth_value(ListBase *editnurb,
for (last_sel = 0; last_sel < nu->pntsu; last_sel++) {
/* loop over selection segments of a curve, smooth each */
- /* Start BezTriple code, this is duplicated below for points, make sure these functions stay in sync */
+ /* Start BezTriple code,
+ * this is duplicated below for points, make sure these functions stay in sync */
start_sel = -1;
for (bp = &nu->bp[last_sel], a = last_sel; a < nu->pntsu; a++, bp++) {
if (bp->f1 & SELECT) {
@@ -5499,7 +5506,8 @@ static bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction)
while (a--) {
if (bp->f1 & SELECT) {
nu->flagu ^= CU_NURB_CYCLIC;
- BKE_nurb_knot_calc_u(nu); /* 1==u type is ignored for cyclic curves */
+ /* 1==u type is ignored for cyclic curves */
+ BKE_nurb_knot_calc_u(nu);
changed = true;
break;
}
@@ -5515,12 +5523,14 @@ static bool curve_toggle_cyclic(View3D *v3d, ListBase *editnurb, int direction)
if (bp->f1 & SELECT) {
if (direction == 0 && nu->pntsu > 1) {
nu->flagu ^= CU_NURB_CYCLIC;
- BKE_nurb_knot_calc_u(nu); /* 1==u type is ignored for cyclic curves */
+ /* 1==u type is ignored for cyclic curves */
+ BKE_nurb_knot_calc_u(nu);
changed = true;
}
if (direction == 1 && nu->pntsv > 1) {
nu->flagv ^= CU_NURB_CYCLIC;
- BKE_nurb_knot_calc_v(nu); /* 2==v type is ignored for cyclic curves */
+ /* 2==v type is ignored for cyclic curves */
+ BKE_nurb_knot_calc_v(nu);
changed = true;
}
break;
diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c
index 5308660ddee..3f53fe8696a 100644
--- a/source/blender/editors/curve/editcurve_add.c
+++ b/source/blender/editors/curve/editcurve_add.c
@@ -343,7 +343,7 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4],
break;
case CU_PRIM_TUBE: /* Cylinder */
if (cutype == CU_NURBS) {
- nu = ED_curve_add_nurbs_primitive(C, obedit, mat, CU_NURBS | CU_PRIM_CIRCLE, 0); /* circle */
+ nu = ED_curve_add_nurbs_primitive(C, obedit, mat, CU_NURBS | CU_PRIM_CIRCLE, 0);
nu->resolu = cu->resolu;
nu->flag = CU_SMOOTH;
BLI_addtail(editnurb, nu); /* temporal for extrude and translate */
@@ -420,7 +420,7 @@ Nurb *ED_curve_add_nurbs_primitive(bContext *C, Object *obedit, float mat[4][4],
float tmp_vec[3] = {0.f, 0.f, 1.f};
xzproj = 1;
- nu = ED_curve_add_nurbs_primitive(C, obedit, mat, CU_NURBS | CU_PRIM_CIRCLE, 0); /* circle */
+ nu = ED_curve_add_nurbs_primitive(C, obedit, mat, CU_NURBS | CU_PRIM_CIRCLE, 0);
xzproj = 0;
nu->resolu = cu->resolu;
nu->resolv = cu->resolv;
diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c
index e6747856d1e..7c31527dfe7 100644
--- a/source/blender/editors/gpencil/annotate_draw.c
+++ b/source/blender/editors/gpencil/annotate_draw.c
@@ -80,13 +80,20 @@
/* ----- General Defines ------ */
/* flags for sflag */
typedef enum eDrawStrokeFlags {
- GP_DRAWDATA_NOSTATUS = (1 << 0), /* don't draw status info */
- GP_DRAWDATA_ONLY3D = (1 << 1), /* only draw 3d-strokes */
- GP_DRAWDATA_ONLYV2D = (1 << 2), /* only draw 'canvas' strokes */
- GP_DRAWDATA_ONLYI2D = (1 << 3), /* only draw 'image' strokes */
- GP_DRAWDATA_IEDITHACK = (1 << 4), /* special hack for drawing strokes in Image Editor (weird coordinates) */
- GP_DRAWDATA_NO_XRAY = (1 << 5), /* don't draw xray in 3D view (which is default) */
- GP_DRAWDATA_NO_ONIONS = (1 << 6), /* no onionskins should be drawn (for animation playback) */
+ /** don't draw status info */
+ GP_DRAWDATA_NOSTATUS = (1 << 0),
+ /** only draw 3d-strokes */
+ GP_DRAWDATA_ONLY3D = (1 << 1),
+ /** only draw 'canvas' strokes */
+ GP_DRAWDATA_ONLYV2D = (1 << 2),
+ /** only draw 'image' strokes */
+ GP_DRAWDATA_ONLYI2D = (1 << 3),
+ /** special hack for drawing strokes in Image Editor (weird coordinates) */
+ GP_DRAWDATA_IEDITHACK = (1 << 4),
+ /** don't draw xray in 3D view (which is default) */
+ GP_DRAWDATA_NO_XRAY = (1 << 5),
+ /** no onionskins should be drawn (for animation playback) */
+ GP_DRAWDATA_NO_ONIONS = (1 << 6),
} eDrawStrokeFlags;
@@ -272,7 +279,8 @@ static void gp_draw_stroke_3d(
* Note: we want more visible levels of pressures when thickness is bigger.
*/
if (fabsf(pt->pressure - curpressure) > 0.2f / (float)thickness) {
- /* if the pressure changes before get at least 2 vertices, need to repeat last point to avoid assert in immEnd() */
+ /* if the pressure changes before get at least 2 vertices,
+ * need to repeat last point to avoid assert in immEnd() */
if (draw_points < 2) {
const bGPDspoint *pt2 = pt - 1;
immVertex3fv(pos, &pt2->x);
@@ -954,7 +962,8 @@ static void gp_draw_data_all(
gpd_source = (scene->gpd ? scene->gpd : NULL);
}
else if (spacetype == SPACE_CLIP && scene->clip) {
- /* currently drawing only gpencil data from either clip or track, but not both - XXX fix logic behind */
+ /* currently drawing only gpencil data from either clip or track,
+ * but not both - XXX fix logic behind */
gpd_source = (scene->clip->gpd ? scene->clip->gpd : NULL);
}
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index 7991c317468..a5382ebf8e2 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -2370,7 +2370,8 @@ void GPENCIL_OT_annotate(wmOperatorType *ot)
prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
- /* NOTE: wait for input is enabled by default, so that all UI code can work properly without needing users to know about this */
+ /* NOTE: wait for input is enabled by default,
+ * so that all UI code can work properly without needing users to know about this */
prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Wait for first click instead of painting immediately");
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 392c670696b..87c7017c677 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -90,15 +90,24 @@
/* ----- General Defines ------ */
/* flags for sflag */
typedef enum eDrawStrokeFlags {
- GP_DRAWDATA_NOSTATUS = (1 << 0), /* don't draw status info */
- GP_DRAWDATA_ONLY3D = (1 << 1), /* only draw 3d-strokes */
- GP_DRAWDATA_ONLYV2D = (1 << 2), /* only draw 'canvas' strokes */
- GP_DRAWDATA_ONLYI2D = (1 << 3), /* only draw 'image' strokes */
- GP_DRAWDATA_IEDITHACK = (1 << 4), /* special hack for drawing strokes in Image Editor (weird coordinates) */
- GP_DRAWDATA_NO_XRAY = (1 << 5), /* don't draw xray in 3D view (which is default) */
- GP_DRAWDATA_NO_ONIONS = (1 << 6), /* no onionskins should be drawn (for animation playback) */
- GP_DRAWDATA_VOLUMETRIC = (1 << 7), /* draw strokes as "volumetric" circular billboards */
- GP_DRAWDATA_FILL = (1 << 8) /* fill insides/bounded-regions of strokes */
+ /** don't draw status info */
+ GP_DRAWDATA_NOSTATUS = (1 << 0),
+ /** only draw 3d-strokes */
+ GP_DRAWDATA_ONLY3D = (1 << 1),
+ /** only draw 'canvas' strokes */
+ GP_DRAWDATA_ONLYV2D = (1 << 2),
+ /** only draw 'image' strokes */
+ GP_DRAWDATA_ONLYI2D = (1 << 3),
+ /** special hack for drawing strokes in Image Editor (weird coordinates) */
+ GP_DRAWDATA_IEDITHACK = (1 << 4),
+ /** don't draw xray in 3D view (which is default) */
+ GP_DRAWDATA_NO_XRAY = (1 << 5),
+ /** no onionskins should be drawn (for animation playback) */
+ GP_DRAWDATA_NO_ONIONS = (1 << 6),
+ /** draw strokes as "volumetric" circular billboards */
+ GP_DRAWDATA_VOLUMETRIC = (1 << 7),
+ /** fill insides/bounded-regions of strokes */
+ GP_DRAWDATA_FILL = (1 << 8)
} eDrawStrokeFlags;
@@ -342,7 +351,10 @@ static void gp_draw_stroke_volumetric_buffer(
const tGPspoint *pt = points;
for (int i = 0; i < totpoints; i++, pt++) {
gp_set_tpoint_varying_color(pt, ink, color);
- immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform (zoom level) */
+
+ /* TODO: scale based on view transform (zoom level) */
+ immAttr1f(size, pt->pressure * thickness);
+
immVertex2f(pos, pt->x, pt->y);
}
@@ -403,8 +415,10 @@ static void gp_draw_stroke_volumetric_3d(
const bGPDspoint *pt = points;
for (int i = 0; i < totpoints && pt; i++, pt++) {
gp_set_point_varying_color(pt, ink, color);
- immAttr1f(size, pt->pressure * thickness); /* TODO: scale based on view transform */
- immVertex3fv(pos, &pt->x); /* we can adjust size in vertex shader based on view/projection! */
+ /* TODO: scale based on view transform */
+ immAttr1f(size, pt->pressure * thickness);
+ /* we can adjust size in vertex shader based on view/projection! */
+ immVertex3fv(pos, &pt->x);
}
immEnd();
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 412330ccf5c..3f21a076bea 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -707,7 +707,8 @@ static bool gp_brush_twist_apply(
axis_angle_normalized_to_mat3(rmat, axis, angle);
/* Rotate point (no matrix-space transforms needed, as GP points are in world space) */
- sub_v3_v3v3(vec, &pt->x, gso->dvec); /* make relative to center (center is stored in dvec) */
+ sub_v3_v3v3(vec, &pt->x, gso->dvec); /* make relative to center
+ * (center is stored in dvec) */
mul_m3_v3(rmat, vec);
add_v3_v3v3(&pt->x, vec, gso->dvec); /* restore */
diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c
index cb3fcba45e1..a880e6c3bf6 100644
--- a/source/blender/editors/gpencil/gpencil_convert.c
+++ b/source/blender/editors/gpencil/gpencil_convert.c
@@ -1129,7 +1129,7 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect)
if (rv3d->persp == RV3D_CAMOB) {
Scene *scene = CTX_data_scene(C);
Depsgraph *depsgraph = CTX_data_depsgraph(C);
- ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, subrect, true); /* no shift */
+ ED_view3d_calc_camera_border(scene, depsgraph, ar, v3d, rv3d, subrect, true);
return 1;
}
}
@@ -1137,7 +1137,8 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect)
return 0;
}
-/* convert a given grease-pencil layer to a 3d-curve representation (using current view if appropriate) */
+/* convert a given grease-pencil layer to a 3d-curve representation
+ * (using current view if appropriate) */
static void gp_layer_to_curve(
bContext *C, ReportList *reports, bGPdata *gpd, bGPDlayer *gpl, const int mode,
const bool norm_weights, const float rad_fac, const bool link_strokes, tGpTimingData *gtd)
@@ -1190,7 +1191,8 @@ static void gp_layer_to_curve(
const bool add_start_point = (link_strokes && !(prev_gps));
const bool add_end_point = (link_strokes && !(gps->next));
- /* Detect new strokes created because of GP_STROKE_BUFFER_MAX reached, and stitch them to previous one. */
+ /* Detect new strokes created because of GP_STROKE_BUFFER_MAX reached,
+ * and stitch them to previous one. */
bool stitch = false;
if (prev_gps) {
bGPDspoint *pt1 = &prev_gps->points[prev_gps->totpoints - 1];
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 8afb0cafeb9..33521d7b53e 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -112,7 +112,8 @@ static int gp_data_add_exec(bContext *C, wmOperator *op)
}
else {
/* decrement user count and add new datablock */
- /* TODO: if a datablock exists, we should make a copy of it instead of starting fresh (as in other areas) */
+ /* TODO: if a datablock exists,
+ * we should make a copy of it instead of starting fresh (as in other areas) */
Main *bmain = CTX_data_main(C);
/* decrement user count of old GP datablock */
@@ -1887,7 +1888,8 @@ static void joined_gpencil_fix_animdata_cb(ID *id, FCurve *fcu, void *user_data)
const char *old_name = BLI_ghashIterator_getKey(&gh_iter);
const char *new_name = BLI_ghashIterator_getValue(&gh_iter);
- /* only remap if changed; this still means there will be some waste if there aren't many drivers/keys */
+ /* only remap if changed;
+ * this still means there will be some waste if there aren't many drivers/keys */
if (!STREQ(old_name, new_name) && strstr(fcu->rna_path, old_name)) {
fcu->rna_path = BKE_animsys_fix_rna_path_rename(
id, fcu->rna_path, "layers",
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 5c6f7de9426..a71545cf392 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -629,7 +629,9 @@ static void gp_duplicate_points(const bGPDstroke *gps, ListBase *new_strokes, co
/* make a stupid copy first of the entire stroke (to get the flags too) */
gpsd = MEM_dupallocN(gps);
- BLI_strncpy(gpsd->runtime.tmp_layerinfo, layername, sizeof(gpsd->runtime.tmp_layerinfo)); /* saves original layer name */
+
+ /* saves original layer name */
+ BLI_strncpy(gpsd->runtime.tmp_layerinfo, layername, sizeof(gpsd->runtime.tmp_layerinfo));
/* initialize triangle memory - will be calculated on next redraw */
gpsd->triangles = NULL;
@@ -930,7 +932,8 @@ static int gp_strokes_copy_exec(bContext *C, wmOperator *op)
/* make direct copies of the stroke and its points */
gpsd = MEM_dupallocN(gps);
- BLI_strncpy(gpsd->runtime.tmp_layerinfo, gpl->info, sizeof(gpsd->runtime.tmp_layerinfo)); /* saves original layer name */
+ /* saves original layer name */
+ BLI_strncpy(gpsd->runtime.tmp_layerinfo, gpl->info, sizeof(gpsd->runtime.tmp_layerinfo));
gpsd->points = MEM_dupallocN(gps->points);
if (gps->dvert != NULL) {
gpsd->dvert = MEM_dupallocN(gps->dvert);
@@ -3061,13 +3064,15 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op)
}
else {
/* Geometry - Snap to surfaces of visible geometry */
- /* XXX: There will be precision loss (possible stairstep artifacts) from this conversion to satisfy the API's */
+ /* XXX: There will be precision loss (possible stairstep artifacts)
+ * from this conversion to satisfy the API's */
const int screen_co[2] = {(int)xy[0], (int)xy[1]};
int depth_margin = 0; // XXX: 4 for strokes, 0 for normal
float depth;
- /* XXX: The proper procedure computes the depths into an array, to have smooth transitions when all else fails... */
+ /* XXX: The proper procedure computes the depths into an array,
+ * to have smooth transitions when all else fails... */
if (ED_view3d_autodist_depth(gsc.ar, screen_co, depth_margin, &depth)) {
ED_view3d_autodist_simple(gsc.ar, screen_co, &pt->x, 0, &depth);
}
diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index aa1a3a6cc76..dceb1b46898 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -91,39 +91,67 @@ typedef struct tGPDfill {
bContext *C;
struct Main *bmain;
struct Depsgraph *depsgraph;
- struct wmWindow *win; /* window where painting originated */
- struct Scene *scene; /* current scene from context */
- struct Object *ob; /* current active gp object */
- struct ScrArea *sa; /* area where painting originated */
- struct RegionView3D *rv3d; /* region where painting originated */
- struct View3D *v3d; /* view3 where painting originated */
- struct ARegion *ar; /* region where painting originated */
- struct bGPdata *gpd; /* current GP datablock */
- struct Material *mat; /* current material */
- struct bGPDlayer *gpl; /* layer */
- struct bGPDframe *gpf; /* frame */
-
- short flag; /* flags */
- short oldkey; /* avoid too fast events */
- bool on_back; /* send to back stroke */
-
- int center[2]; /* mouse fill center position */
- int sizex; /* windows width */
- int sizey; /* window height */
- int lock_axis; /* lock to viewport axis */
-
- short fill_leak; /* number of pixel to consider the leak is too small (x 2) */
- float fill_threshold; /* factor for transparency */
- int fill_simplylvl; /* number of simplify steps */
- int fill_draw_mode; /* boundary limits drawing mode */
-
- short sbuffer_size; /* number of elements currently in cache */
- void *sbuffer; /* temporary points */
- float *depth_arr; /* depth array for reproject */
-
- Image *ima; /* temp image */
- BLI_Stack *stack; /* temp points data */
- void *draw_handle_3d; /* handle for drawing strokes while operator is running 3d stuff */
+ /** window where painting originated */
+ struct wmWindow *win;
+ /** current scene from context */
+ struct Scene *scene;
+ /** current active gp object */
+ struct Object *ob;
+ /** area where painting originated */
+ struct ScrArea *sa;
+ /** region where painting originated */
+ struct RegionView3D *rv3d;
+ /** view3 where painting originated */
+ struct View3D *v3d;
+ /** region where painting originated */
+ struct ARegion *ar;
+ /** current GP datablock */
+ struct bGPdata *gpd;
+ /** current material */
+ struct Material *mat;
+ /** layer */
+ struct bGPDlayer *gpl;
+ /** frame */
+ struct bGPDframe *gpf;
+
+ /** flags */
+ short flag;
+ /** avoid too fast events */
+ short oldkey;
+ /** send to back stroke */
+ bool on_back;
+
+ /** mouse fill center position */
+ int center[2];
+ /** windows width */
+ int sizex;
+ /** window height */
+ int sizey;
+ /** lock to viewport axis */
+ int lock_axis;
+
+ /** number of pixel to consider the leak is too small (x 2) */
+ short fill_leak;
+ /** factor for transparency */
+ float fill_threshold;
+ /** number of simplify steps */
+ int fill_simplylvl;
+ /** boundary limits drawing mode */
+ int fill_draw_mode;
+
+ /** number of elements currently in cache */
+ short sbuffer_size;
+ /** temporary points */
+ void *sbuffer;
+ /** depth array for reproject */
+ float *depth_arr;
+
+ /** temp image */
+ Image *ima;
+ /** temp points data */
+ BLI_Stack *stack;
+ /** handle for drawing strokes while operator is running 3d stuff */
+ void *draw_handle_3d;
} tGPDfill;
diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h
index 56ddf81f357..0ccc8791667 100644
--- a/source/blender/editors/gpencil/gpencil_intern.h
+++ b/source/blender/editors/gpencil/gpencil_intern.h
@@ -107,79 +107,135 @@ typedef struct tGPDdraw {
typedef struct tGPDinterpolate_layer {
struct tGPDinterpolate_layer *next, *prev;
- struct bGPDlayer *gpl; /* layer */
- struct bGPDframe *prevFrame; /* frame before current frame (interpolate-from) */
- struct bGPDframe *nextFrame; /* frame after current frame (interpolate-to) */
- struct bGPDframe *interFrame; /* interpolated frame */
- float factor; /* interpolate factor */
+ /** layer */
+ struct bGPDlayer *gpl;
+ /** frame before current frame (interpolate-from) */
+ struct bGPDframe *prevFrame;
+ /** frame after current frame (interpolate-to) */
+ struct bGPDframe *nextFrame;
+ /** interpolated frame */
+ struct bGPDframe *interFrame;
+ /** interpolate factor */
+ float factor;
} tGPDinterpolate_layer;
typedef struct tGPDinterpolate {
- struct Scene *scene; /* current scene from context */
- struct ScrArea *sa; /* area where painting originated */
- struct ARegion *ar; /* region where painting originated */
- struct bGPdata *gpd; /* current GP datablock */
- struct Material *mat; /* current material */
-
- int cframe; /* current frame number */
- ListBase ilayers; /* (tGPDinterpolate_layer) layers to be interpolated */
- float shift; /* value for determining the displacement influence */
- float init_factor; /* initial interpolation factor for active layer */
- float low_limit; /* shift low limit (-100%) */
- float high_limit; /* shift upper limit (200%) */
- int flag; /* flag from toolsettings */
+ /** current scene from context */
+ struct Scene *scene;
+ /** area where painting originated */
+ struct ScrArea *sa;
+ /** region where painting originated */
+ struct ARegion *ar;
+ /** current GP datablock */
+ struct bGPdata *gpd;
+ /** current material */
+ struct Material *mat;
+
+ /** current frame number */
+ int cframe;
+ /** (tGPDinterpolate_layer) layers to be interpolated */
+ ListBase ilayers;
+ /** value for determining the displacement influence */
+ float shift;
+ /** initial interpolation factor for active layer */
+ float init_factor;
+ /** shift low limit (-100%) */
+ float low_limit;
+ /** shift upper limit (200%) */
+ float high_limit;
+ /** flag from toolsettings */
+ int flag;
NumInput num; /* numeric input */
- void *draw_handle_3d; /* handle for drawing strokes while operator is running 3d stuff */
- void *draw_handle_screen; /* handle for drawing strokes while operator is running screen stuff */
+ /** handle for drawing strokes while operator is running 3d stuff */
+ void *draw_handle_3d;
+ /** handle for drawing strokes while operator is running screen stuff */
+ void *draw_handle_screen;
} tGPDinterpolate;
/* Temporary primitive operation data */
typedef struct tGPDprimitive {
- struct Main *bmain; /* main database pointer */
+ /** main database pointer */
+ struct Main *bmain;
struct Depsgraph *depsgraph;
- struct wmWindow *win; /* window where painting originated */
- struct Scene *scene; /* current scene from context */
- struct Object *ob; /* current active gp object */
- struct ScrArea *sa; /* area where painting originated */
- struct RegionView3D *rv3d; /* region where painting originated */
- struct View3D *v3d; /* view3d where painting originated */
- struct ARegion *ar; /* region where painting originated */
- struct bGPdata *gpd; /* current GP datablock */
- struct Material *mat; /* current material */
- struct Brush *brush; /* current brush */
-
- int cframe; /* current frame number */
- struct bGPDlayer *gpl; /* layer */
- struct bGPDframe *gpf; /* frame */
- int type; /* type of primitive */
- int orign_type; /* original type of primitive */
- bool curve; /* type of primitive is a curve */
- int brush_size; /* brush size */
- float brush_strength; /* brush strength */
- short flip; /* flip option */
- tGPspoint *points; /* array of data-points for stroke */
- int point_count; /* number of edges allocated */
- int tot_stored_edges; /* stored number of polygon edges */
- int tot_edges; /* number of polygon edges */
- float move[2]; /* move distance */
- float origin[2]; /* initial box corner */
- float start[2]; /* first box corner */
- float end[2]; /* last box corner */
- float midpoint[2]; /* midpoint box corner */
- float cp1[2]; /* first control point */
- float cp2[2]; /* second control point */
- int sel_cp; /* flag to determine control point is selected */
- int flag; /* flag to determine operations in progress */
- float mval[2]; /* recorded mouse-position */
- float mvalo[2]; /* previous recorded mouse-position */
-
- int lock_axis; /* lock to viewport axis */
+ /** window where painting originated */
+ struct wmWindow *win;
+ /** current scene from context */
+ struct Scene *scene;
+ /** current active gp object */
+ struct Object *ob;
+ /** area where painting originated */
+ struct ScrArea *sa;
+ /** region where painting originated */
+ struct RegionView3D *rv3d;
+ /** view3d where painting originated */
+ struct View3D *v3d;
+ /** region where painting originated */
+ struct ARegion *ar;
+ /** current GP datablock */
+ struct bGPdata *gpd;
+ /** current material */
+ struct Material *mat;
+ /** current brush */
+ struct Brush *brush;
+
+ /** current frame number */
+ int cframe;
+ /** layer */
+ struct bGPDlayer *gpl;
+ /** frame */
+ struct bGPDframe *gpf;
+ /** type of primitive */
+ int type;
+ /** original type of primitive */
+ int orign_type;
+ /** type of primitive is a curve */
+ bool curve;
+ /** brush size */
+ int brush_size;
+ /** brush strength */
+ float brush_strength;
+ /** flip option */
+ short flip;
+ /** array of data-points for stroke */
+ tGPspoint *points;
+ /** number of edges allocated */
+ int point_count;
+ /** stored number of polygon edges */
+ int tot_stored_edges;
+ /** number of polygon edges */
+ int tot_edges;
+ /** move distance */
+ float move[2];
+ /** initial box corner */
+ float origin[2];
+ /** first box corner */
+ float start[2];
+ /** last box corner */
+ float end[2];
+ /** midpoint box corner */
+ float midpoint[2];
+ /** first control point */
+ float cp1[2];
+ /** second control point */
+ float cp2[2];
+ /** flag to determine control point is selected */
+ int sel_cp;
+ /** flag to determine operations in progress */
+ int flag;
+ /** recorded mouse-position */
+ float mval[2];
+ /** previous recorded mouse-position */
+ float mvalo[2];
+
+ /** lock to viewport axis */
+ int lock_axis;
struct RNG *rng;
- NumInput num; /* numeric input */
+ /** numeric input */
+ NumInput num;
} tGPDprimitive;
diff --git a/source/blender/editors/gpencil/gpencil_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c
index 86a8e3479f3..4b1706f50b7 100644
--- a/source/blender/editors/gpencil/gpencil_interpolate.c
+++ b/source/blender/editors/gpencil/gpencil_interpolate.c
@@ -1112,7 +1112,8 @@ static int gpencil_interpolate_reverse_exec(bContext *C, wmOperator *UNUSED(op))
gpf = gpf->prev;
}
else {
- /* Not a breakdown (may be a key, or an extreme, or something else that wasn't generated)... stop */
+ /* Not a breakdown (may be a key, or an extreme,
+ * or something else that wasn't generated)... stop */
break;
}
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index baf8ca41062..46b3d539477 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -2931,7 +2931,8 @@ static void gpencil_draw_apply_event(bContext *C, wmOperator *op, const wmEvent
gpencil_draw_apply(C, op, p, depsgraph);
/* force refresh */
- ED_region_tag_redraw(p->ar); /* just active area for now, since doing whole screen is too slow */
+ /* just active area for now, since doing whole screen is too slow */
+ ED_region_tag_redraw(p->ar);
}
/* ------------------------------- */
@@ -3761,7 +3762,8 @@ void GPENCIL_OT_draw(wmOperatorType *ot)
prop = RNA_def_collection_runtime(ot->srna, "stroke", &RNA_OperatorStrokeElement, "Stroke", "");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
- /* NOTE: wait for input is enabled by default, so that all UI code can work properly without needing users to know about this */
+ /* NOTE: wait for input is enabled by default,
+ * so that all UI code can work properly without needing users to know about this */
prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "Wait for first click instead of painting immediately");
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c
index fb5efb01f94..7d0d71bd348 100644
--- a/source/blender/editors/gpencil/gpencil_select.c
+++ b/source/blender/editors/gpencil/gpencil_select.c
@@ -998,7 +998,8 @@ static int gpencil_circle_select_exec(bContext *C, wmOperator *op)
bool select = !RNA_boolean_get(op->ptr, "deselect");
GP_SpaceConversion gsc = {NULL};
- rcti rect = {0}; /* for bounding rect around circle (for quicky intersection testing) */
+ /* for bounding rect around circle (for quicky intersection testing) */
+ rcti rect = {0};
bool changed = false;
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 36ae1a211d3..226a2bc7a98 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -140,7 +140,8 @@ bGPdata **ED_gpencil_data_get_pointers_direct(ID *screen_id, ScrArea *sa, Scene
/* return the GP data for the active node block/node */
if (snode && snode->nodetree) {
- /* for now, as long as there's an active node tree, default to using that in the Nodes Editor */
+ /* for now, as long as there's an active node tree,
+ * default to using that in the Nodes Editor */
if (r_ptr) RNA_id_pointer_create(&snode->nodetree->id, r_ptr);
return &snode->nodetree->gpd;
}
@@ -546,7 +547,7 @@ void gp_point_conversion_init(bContext *C, GP_SpaceConversion *r_gsc)
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
- ED_view3d_calc_camera_border(scene, CTX_data_depsgraph(C), ar, v3d, rv3d, &r_gsc->subrect_data, true); /* no shift */
+ ED_view3d_calc_camera_border(scene, CTX_data_depsgraph(C), ar, v3d, rv3d, &r_gsc->subrect_data, true);
r_gsc->subrect = &r_gsc->subrect_data;
}
}
@@ -1215,7 +1216,8 @@ void ED_gpencil_parent_location(
mul_m4_m4m4(diff_mat, tmp_mat, gpl->inverse);
}
else {
- mul_m4_m4m4(diff_mat, obparent_eval->obmat, gpl->inverse); /* if bone not found use object (armature) */
+ /* if bone not found use object (armature) */
+ mul_m4_m4m4(diff_mat, obparent_eval->obmat, gpl->inverse);
}
return;
}
diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h
index bbc9f25b542..ec7c5f989d0 100644
--- a/source/blender/editors/include/ED_anim_api.h
+++ b/source/blender/editors/include/ED_anim_api.h
@@ -69,29 +69,46 @@ struct PropertyRNA;
* 'context' information
*/
typedef struct bAnimContext {
- void *data; /* data to be filtered for use in animation editor */
- short datatype; /* type of data eAnimCont_Types */
-
- short mode; /* editor->mode */
- short spacetype; /* sa->spacetype */
- short regiontype; /* active region -> type (channels or main) */
-
- struct ScrArea *sa; /* editor host */
- struct SpaceLink *sl; /* editor data */
- struct ARegion *ar; /* region within editor */
-
- struct bDopeSheet *ads; /* dopesheet data for editor (or which is being used) */
-
- struct Depsgraph *depsgraph; /* active dependency graph */
- struct Main *bmain; /* Current Main */
- struct Scene *scene; /* active scene */
- struct ViewLayer *view_layer; /* active scene layer */
- struct Object *obact; /* active object */
- ListBase *markers; /* active set of markers */
-
- struct ReportList *reports; /* pointer to current reports list */
-
- float yscale_fac; /* scale factor for height of channels (i.e. based on the size of keyframes) */
+ /** data to be filtered for use in animation editor */
+ void *data;
+ /** type of data eAnimCont_Types */
+ short datatype;
+
+ /** editor->mode */
+ short mode;
+ /** sa->spacetype */
+ short spacetype;
+ /** active region -> type (channels or main) */
+ short regiontype;
+
+ /** editor host */
+ struct ScrArea *sa;
+ /** editor data */
+ struct SpaceLink *sl;
+ /** region within editor */
+ struct ARegion *ar;
+
+ /** dopesheet data for editor (or which is being used) */
+ struct bDopeSheet *ads;
+
+ /** active dependency graph */
+ struct Depsgraph *depsgraph;
+ /** Current Main */
+ struct Main *bmain;
+ /** active scene */
+ struct Scene *scene;
+ /** active scene layer */
+ struct ViewLayer *view_layer;
+ /** active object */
+ struct Object *obact;
+ /** active set of markers */
+ ListBase *markers;
+
+ /** pointer to current reports list */
+ struct ReportList *reports;
+
+ /** Scale factor for height of channels (i.e. based on the size of keyframes). */
+ float yscale_fac;
} bAnimContext;
/* Main Data container types */
@@ -117,31 +134,44 @@ typedef enum eAnimCont_Types {
typedef struct bAnimListElem {
struct bAnimListElem *next, *prev;
- void *data; /* source data this elem represents */
- int type; /* (eAnim_ChannelType) one of the ANIMTYPE_* values */
- int flag; /* copy of elem's flags for quick access */
- int index; /* for un-named data, the index of the data in its collection */
-
- char update; /* (eAnim_Update_Flags) tag the element for updating */
- char tag; /* tag the included data. Temporary always */
-
- short datatype; /* (eAnim_KeyType) type of motion data to expect */
- void *key_data; /* motion data - mostly F-Curves, but can be other types too */
-
-
- /* NOTE: id here is the "IdAdtTemplate"-style datablock (e.g. Object, Material, Texture, NodeTree)
- * from which evaluation of the RNA-paths takes place. It's used to figure out how deep
- * channels should be nested (e.g. for Textures/NodeTrees) in the tree, and allows property
- * lookups (e.g. for sliders and for inserting keyframes) to work. If we had instead used
- * bAction or something similar, none of this would be possible: although it's trivial
- * to use an IdAdtTemplate type to find the source action a channel (e.g. F-Curve) comes from
- * (i.e. in the AnimEditors, it *must* be the active action, as only that can be edited),
- * it's impossible to go the other way (i.e. one action may be used in multiple places).
+ /** source data this elem represents */
+ void *data;
+ /** (eAnim_ChannelType) one of the ANIMTYPE_* values */
+ int type;
+ /** copy of elem's flags for quick access */
+ int flag;
+ /** for un-named data, the index of the data in its collection */
+ int index;
+
+ /** (eAnim_Update_Flags) tag the element for updating */
+ char update;
+ /** tag the included data. Temporary always */
+ char tag;
+
+ /** (eAnim_KeyType) type of motion data to expect */
+ short datatype;
+ /** motion data - mostly F-Curves, but can be other types too */
+ void *key_data;
+
+
+ /**
+ * \note
+ * id here is the "IdAdtTemplate"-style datablock (e.g. Object, Material, Texture, NodeTree)
+ * from which evaluation of the RNA-paths takes place. It's used to figure out how deep
+ * channels should be nested (e.g. for Textures/NodeTrees) in the tree, and allows property
+ * lookups (e.g. for sliders and for inserting keyframes) to work. If we had instead used
+ * bAction or something similar, none of this would be possible: although it's trivial
+ * to use an IdAdtTemplate type to find the source action a channel (e.g. F-Curve) comes from
+ * (i.e. in the AnimEditors, it *must* be the active action, as only that can be edited),
+ * it's impossible to go the other way (i.e. one action may be used in multiple places).
*/
- struct ID *id; /* ID block that channel is attached to */
- struct AnimData *adt; /* source of the animation data attached to ID block (for convenience) */
+ /** ID block that channel is attached to */
+ struct ID *id;
+ /** source of the animation data attached to ID block (for convenience) */
+ struct AnimData *adt;
- /* For list element which corresponds to a f-curve, this is an ID which
+ /**
+ * For list element which corresponds to a f-curve, this is an ID which
* owns the f-curve.
*
* For example, if the f-curve is coming from Action, this id will be set to
@@ -153,13 +183,18 @@ typedef struct bAnimListElem {
* object. */
struct ID *fcurve_owner_id;
- void *owner; /* for per-element F-Curves (e.g. NLA Control Curves), the element that this represents (e.g. NlaStrip) */
+ /**
+ * for per-element F-Curves
+ * (e.g. NLA Control Curves), the element that this represents (e.g. NlaStrip) */
+ void *owner;
} bAnimListElem;
-/* Some types for easier type-testing
- * NOTE: need to keep the order of these synchronized with the channels define code
- * which is used for drawing and handling channel lists for
+/**
+ * Some types for easier type-testing
+ *
+ * \note need to keep the order of these synchronized with the channels define code
+ * which is used for drawing and handling channel lists for.
*/
typedef enum eAnim_ChannelType {
ANIMTYPE_NONE = 0,
@@ -248,42 +283,46 @@ typedef enum eAnim_Update_Flags {
/* filtering flags - under what circumstances should a channel be returned */
typedef enum eAnimFilter_Flags {
- /* data which channel represents is fits the dopesheet filters (i.e. scene visibility criteria) */
+ /** data which channel represents is fits the dopesheet filters
+ * (i.e. scene visibility criteria) */
// XXX: it's hard to think of any examples where this *ISN'T* the case... perhaps becomes implicit?
ANIMFILTER_DATA_VISIBLE = (1 << 0),
- /* channel is visible within the channel-list hierarchy (i.e. F-Curves within Groups in ActEdit) */
+ /** channel is visible within the channel-list hierarchy
+ * (i.e. F-Curves within Groups in ActEdit) */
ANIMFILTER_LIST_VISIBLE = (1 << 1),
- /* channel has specifically been tagged as visible in Graph Editor (* Graph Editor Only) */
+ /** channel has specifically been tagged as visible in Graph Editor (* Graph Editor Only) */
ANIMFILTER_CURVE_VISIBLE = (1 << 2),
- /* include summary channels and "expanders" (for drawing/mouse-selection in channel list) */
+ /** include summary channels and "expanders" (for drawing/mouse-selection in channel list) */
ANIMFILTER_LIST_CHANNELS = (1 << 3),
- /* for its type, channel should be "active" one */
+ /** for its type, channel should be "active" one */
ANIMFILTER_ACTIVE = (1 << 4),
- /* channel is a child of the active group (* Actions speciality) */
+ /** channel is a child of the active group (* Actions speciality) */
ANIMFILTER_ACTGROUPED = (1 << 5),
- /* channel must be selected/not-selected, but both must not be set together */
+ /** channel must be selected/not-selected, but both must not be set together */
ANIMFILTER_SEL = (1 << 6),
ANIMFILTER_UNSEL = (1 << 7),
- /* editability status - must be editable to be included */
+ /** editability status - must be editable to be included */
ANIMFILTER_FOREDIT = (1 << 8),
- /* only selected animchannels should be considerable as editable - mainly for Graph Editor's option for keys on select curves only */
+ /** only selected animchannels should be considerable as editable - mainly
+ * for Graph Editor's option for keys on select curves only */
ANIMFILTER_SELEDIT = (1 << 9),
- /* flags used to enforce certain data types */
- // NOTE: the ones for curves and NLA tracks were redundant and have been removed for now...
+ /** flags used to enforce certain data types
+ * \node the ones for curves and NLA tracks were redundant and have been removed for now...
+ */
ANIMFILTER_ANIMDATA = (1 << 10),
- /* duplicate entries for animation data attached to multi-user blocks must not occur */
+ /** duplicate entries for animation data attached to multi-user blocks must not occur */
ANIMFILTER_NODUPLIS = (1 << 11),
- /* for checking if we should keep some collapsed channel around (internal use only!) */
+ /** for checking if we should keep some collapsed channel around (internal use only!) */
ANIMFILTER_TMP_PEEK = (1 << 30),
- /* ignore ONLYSEL flag from filterflag, (internal use only!) */
+ /** ignore ONLYSEL flag from filterflag, (internal use only!) */
ANIMFILTER_TMP_IGNORE_ONLYSEL = (1u << 31)
} eAnimFilter_Flags;
@@ -429,30 +468,42 @@ void ANIM_animdata_freelist(ListBase *anim_data);
/* role or level of animchannel in the hierarchy */
typedef enum eAnimChannel_Role {
- ACHANNEL_ROLE_EXPANDER = -1, /* datablock expander - a "composite" channel type */
- ACHANNEL_ROLE_SPECIAL = 0, /* special purposes - not generally for hierarchy processing */
- ACHANNEL_ROLE_CHANNEL = 1 /* data channel - a channel representing one of the actual building blocks of channels */
+ /** datablock expander - a "composite" channel type */
+ ACHANNEL_ROLE_EXPANDER = -1,
+ /** special purposes - not generally for hierarchy processing */
+ ACHANNEL_ROLE_SPECIAL = 0,
+ /** data channel - a channel representing one of the actual building blocks of channels */
+ ACHANNEL_ROLE_CHANNEL = 1
} eAnimChannel_Role;
/* flag-setting behavior */
typedef enum eAnimChannels_SetFlag {
- ACHANNEL_SETFLAG_CLEAR = 0, /* turn off */
- ACHANNEL_SETFLAG_ADD = 1, /* turn on */
- ACHANNEL_SETFLAG_INVERT = 2, /* on->off, off->on */
- ACHANNEL_SETFLAG_TOGGLE = 3 /* some on -> all off // all on */
+ /** turn off */
+ ACHANNEL_SETFLAG_CLEAR = 0,
+ /** turn on */
+ ACHANNEL_SETFLAG_ADD = 1,
+ /** on->off, off->on */
+ ACHANNEL_SETFLAG_INVERT = 2,
+ /** some on -> all off // all on */
+ ACHANNEL_SETFLAG_TOGGLE = 3
} eAnimChannels_SetFlag;
/* types of settings for AnimChannels */
typedef enum eAnimChannel_Settings {
ACHANNEL_SETTING_SELECT = 0,
- ACHANNEL_SETTING_PROTECT = 1, /* warning: for drawing UI's, need to check if this is off (maybe inverse this later) */
+ /** warning: for drawing UI's, need to check if this is off (maybe inverse this later) */
+ ACHANNEL_SETTING_PROTECT = 1,
ACHANNEL_SETTING_MUTE = 2,
ACHANNEL_SETTING_EXPAND = 3,
- ACHANNEL_SETTING_VISIBLE = 4, /* only for Graph Editor */
- ACHANNEL_SETTING_SOLO = 5, /* only for NLA Tracks */
- ACHANNEL_SETTING_PINNED = 6, /* only for NLA Actions */
+ /** only for Graph Editor */
+ ACHANNEL_SETTING_VISIBLE = 4,
+ /** only for NLA Tracks */
+ ACHANNEL_SETTING_SOLO = 5,
+ /** only for NLA Actions */
+ ACHANNEL_SETTING_PINNED = 6,
ACHANNEL_SETTING_MOD_OFF = 7,
- ACHANNEL_SETTING_ALWAYS_VISIBLE = 8, /* channel is pinned and always visible */
+ /** channel is pinned and always visible */
+ ACHANNEL_SETTING_ALWAYS_VISIBLE = 8,
} eAnimChannel_Settings;
@@ -542,7 +593,8 @@ void ANIM_deselect_anim_channels(bAnimContext *ac, void *data, eAnimCont_Types d
void ANIM_set_active_channel(bAnimContext *ac, void *data, eAnimCont_Types datatype, eAnimFilter_Flags filter, void *channel_data, eAnim_ChannelType channel_type);
-/* Delete the F-Curve from the given AnimData block (if possible), as appropriate according to animation context */
+/* Delete the F-Curve from the given AnimData block (if possible),
+ * as appropriate according to animation context */
void ANIM_fcurve_delete_from_animdata(bAnimContext *ac, struct AnimData *adt, struct FCurve *fcu);
/* ************************************************ */
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index 3306fa09f12..bce04f4382f 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -58,26 +58,32 @@ struct UndoType;
typedef struct EditBone {
struct EditBone *next, *prev;
- struct IDProperty *prop; /* User-Defined Properties on this Bone */
- struct EditBone *parent; /* Editbones have a one-way link (i.e. children refer
- * to parents. This is converted to a two-way link for
- * normal bones when leaving editmode. */
- char name[64]; /* MAXBONENAME */
- float roll; /* Roll along axis. We'll ultimately use the axis/angle method
- * for determining the transformation matrix of the bone. The axis
- * is tail-head while roll provides the angle. Refer to Graphics
- * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
-
- float head[3]; /* Orientation and length is implicit during editing */
+ /** User-Defined Properties on this Bone */
+ struct IDProperty *prop;
+ /** Editbones have a one-way link (i.e. children refer
+ * to parents. This is converted to a two-way link for
+ * normal bones when leaving editmode. */
+ struct EditBone *parent;
+ /** (64 == MAXBONENAME) */
+ char name[64];
+ /** Roll along axis. We'll ultimately use the axis/angle method
+ * for determining the transformation matrix of the bone. The axis
+ * is tail-head while roll provides the angle. Refer to Graphics
+ * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
+ float roll;
+
+ /** Orientation and length is implicit during editing */
+ float head[3];
float tail[3];
- /* All joints are considered to have zero rotation with respect to
+ /** All joints are considered to have zero rotation with respect to
* their parents. Therefore any rotations specified during the
* animation are automatically relative to the bones' rest positions*/
int flag;
int layer;
float dist, weight;
- float xwidth, length, zwidth; /* put them in order! transform uses this as scale */
+ /** put them in order! transform uses this as scale */
+ float xwidth, length, zwidth;
float rad_head, rad_tail;
/* Bendy-Bone parameters */
@@ -87,22 +93,28 @@ typedef struct EditBone {
float ease1, ease2;
float scaleIn, scaleOut;
- float oldlength; /* for envelope scaling */
+ /** for envelope scaling */
+ float oldlength;
short segments;
- char bbone_prev_type; /* Type of next/prev bone handles */
+ /** Type of next/prev bone handles */
+ char bbone_prev_type;
char bbone_next_type;
- struct EditBone *bbone_prev; /* Next/prev bones to use as handle references when calculating bbones (optional) */
+ /** Next/prev bones to use as handle references when calculating bbones (optional) */
+ struct EditBone *bbone_prev;
struct EditBone *bbone_next;
/* Used for display */
- float disp_mat[4][4]; /* in Armature space, rest pos matrix */
- float disp_tail_mat[4][4]; /* in Armature space, rest pos matrix */
- /* 32 == MAX_BBONE_SUBDIV */
- float disp_bbone_mat[32][4][4]; /* in Armature space, rest pos matrix */
-
- struct EditBone *bbone_child; /* connected child temporary during drawing */
+ /** in Armature space, rest pos matrix */
+ float disp_mat[4][4];
+ /** in Armature space, rest pos matrix */
+ float disp_tail_mat[4][4];
+ /** in Armature space, rest pos matrix (32 == MAX_BBONE_SUBDIV) */
+ float disp_bbone_mat[32][4][4];
+
+ /** connected child temporary during drawing */
+ struct EditBone *bbone_child;
/* Used to store temporary data */
union {
diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h
index 64739d968b8..aa54005ab5e 100644
--- a/source/blender/editors/include/ED_fileselect.h
+++ b/source/blender/editors/include/ED_fileselect.h
@@ -134,8 +134,10 @@ typedef enum FSMenuCategory {
typedef enum FSMenuInsert {
FS_INSERT_SORTED = (1 << 0),
FS_INSERT_SAVE = (1 << 1),
- FS_INSERT_FIRST = (1 << 2), /* moves the item to the front of the list when its not already there */
- FS_INSERT_LAST = (1 << 3), /* just append to preseve delivered order */
+ /** moves the item to the front of the list when its not already there */
+ FS_INSERT_FIRST = (1 << 2),
+ /** just append to preseve delivered order */
+ FS_INSERT_LAST = (1 << 3),
} FSMenuInsert;
struct FSMenu;
diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h
index 87c6c0be45a..9fce191561e 100644
--- a/source/blender/editors/include/ED_keyframes_draw.h
+++ b/source/blender/editors/include/ED_keyframes_draw.h
@@ -67,14 +67,20 @@ typedef struct ActKeyColumn {
struct ActKeyColumn *next, *prev;
/* sorting-tree linkage */
- struct ActKeyColumn *left, *right; /* 'children' of this node, less than and greater than it (respectively) */
- struct ActKeyColumn *parent; /* parent of this node in the tree */
- char tree_col; /* DLRB_BLACK or DLRB_RED */
+ /** 'children' of this node, less than and greater than it (respectively) */
+ struct ActKeyColumn *left, *right;
+ /** parent of this node in the tree */
+ struct ActKeyColumn *parent;
+ /** DLRB_BLACK or DLRB_RED */
+ char tree_col;
/* keyframe info */
- char key_type; /* eBezTripe_KeyframeType */
- char handle_type; /* eKeyframeHandleDrawOpts */
- char extreme_type; /* eKeyframeExtremeDrawOpts */
+ /** eBezTripe_KeyframeType */
+ char key_type;
+ /** eKeyframeHandleDrawOpts */
+ char handle_type;
+ /** eKeyframeExtremeDrawOpts */
+ char extreme_type;
short sel;
float cfra;
@@ -134,7 +140,8 @@ typedef enum eKeyframeExtremeDrawOpts {
} eKeyframeExtremeDrawOpts;
/* draw simple diamond-shape keyframe */
-/* caller should set up vertex format, bind GPU_SHADER_KEYFRAME_DIAMOND, immBegin(GPU_PRIM_POINTS, n), then call this n times */
+/* caller should set up vertex format, bind GPU_SHADER_KEYFRAME_DIAMOND,
+ * immBegin(GPU_PRIM_POINTS, n), then call this n times */
void draw_keyframe_shape(float x, float y, float size, bool sel, short key_type, short mode, float alpha,
unsigned int pos_id, unsigned int size_id, unsigned int color_id, unsigned int outline_color_id,
unsigned int linemask_id, short ipo_type, short extreme_type);
diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h
index e7ea5cf159e..8a398c97506 100644
--- a/source/blender/editors/include/ED_keyframes_edit.h
+++ b/source/blender/editors/include/ED_keyframes_edit.h
@@ -155,20 +155,30 @@ typedef enum eKeyframeIterFlags {
typedef struct KeyframeEditData {
/* generic properties/data access */
- ListBase list; /* temp list for storing custom list of data to check */
- struct Scene *scene; /* pointer to current scene - many tools need access to cfra/etc. */
- void *data; /* pointer to custom data - usually 'Object' but also 'rectf', but could be other types too */
- float f1, f2; /* storage of times/values as 'decimals' */
- int i1, i2; /* storage of times/values/flags as 'whole' numbers */
+ /** temp list for storing custom list of data to check */
+ ListBase list;
+ /** pointer to current scene - many tools need access to cfra/etc. */
+ struct Scene *scene;
+ /** pointer to custom data - usually 'Object' but also 'rectf', but could be other types too */
+ void *data;
+ /** storage of times/values as 'decimals' */
+ float f1, f2;
+ /** storage of times/values/flags as 'whole' numbers */
+ int i1, i2;
/* current iteration data */
- struct FCurve *fcu; /* F-Curve that is being iterated over */
- int curIndex; /* index of current keyframe being iterated over */
- float channel_y; /* y-position of midpoint of the channel (for the dopesheet) */
+ /** F-Curve that is being iterated over */
+ struct FCurve *fcu;
+ /** index of current keyframe being iterated over */
+ int curIndex;
+ /** y-position of midpoint of the channel (for the dopesheet) */
+ float channel_y;
/* flags */
- eKeyframeVertOk curflags; /* current flags for the keyframe we're reached in the iteration process */
- eKeyframeIterFlags iterflags; /* settings for iteration process */
+ /** current flags for the keyframe we're reached in the iteration process */
+ eKeyframeVertOk curflags;
+ /** settings for iteration process */
+ eKeyframeIterFlags iterflags;
} KeyframeEditData;
/* ------- Function Pointer Typedefs ---------------- */
@@ -213,7 +223,8 @@ typedef enum eKeyMergeMode {
/* ---------------- Looping API --------------------- */
/* functions for looping over keyframes */
-/* function for working with F-Curve data only (i.e. when filters have been chosen to explicitly use this) */
+/* function for working with F-Curve data only
+ * (i.e. when filters have been chosen to explicitly use this) */
short ANIM_fcurve_keyframes_loop(KeyframeEditData *ked, struct FCurve *fcu, KeyframeEditFunc key_ok, KeyframeEditFunc key_cb, FcuEditFunc fcu_cb);
/* function for working with any type (i.e. one of the known types) of animation channel
* - filterflag is bDopeSheet->flag (DOPESHEET_FILTERFLAG)
@@ -267,7 +278,8 @@ short bezt_to_cfraelem(KeyframeEditData *ked, struct BezTriple *bezt);
void bezt_remap_times(KeyframeEditData *ked, struct BezTriple *bezt);
/* ------ 1.5-D Region Testing Uitls (Lasso/Circle Select) ------- */
-/* XXX: These are temporary, until we can unify GP/Mask Keyframe handling and standard FCurve Keyframe handling */
+/* XXX: These are temporary,
+ * until we can unify GP/Mask Keyframe handling and standard FCurve Keyframe handling */
bool keyframe_region_lasso_test(
const KeyframeEdit_LassoData *data_lasso,
diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h
index aba381f7989..b1140630dc0 100644
--- a/source/blender/editors/include/ED_keyframing.h
+++ b/source/blender/editors/include/ED_keyframing.h
@@ -195,7 +195,8 @@ typedef enum eModifyKey_Returns {
MODIFYKEY_MISSING_TYPEINFO = -2,
} eModifyKey_Returns;
-/* poll the current KeyingSet, updating it's set of paths (if "builtin"/"relative") for context changes */
+/* poll the current KeyingSet, updating it's set of paths
+ * (if "builtin"/"relative") for context changes */
short ANIM_validate_keyingset(struct bContext *C, ListBase *dsources, struct KeyingSet *ks);
/* use the specified KeyingSet to add/remove various Keyframes on the specified frame */
@@ -203,7 +204,8 @@ int ANIM_apply_keyingset(struct bContext *C, ListBase *dsources, struct bAction
/* -------- */
-/* Get the first builtin KeyingSet with the given name, which occurs after the given one (or start of list if none given) */
+/* Get the first builtin KeyingSet with the given name, which occurs after the given one
+ * (or start of list if none given) */
struct KeyingSet *ANIM_builtin_keyingset_get_named(struct KeyingSet *prevKS, const char name[]);
/* Find KeyingSet type info given a name */
@@ -240,18 +242,27 @@ bool ANIM_keyingset_context_ok_poll(struct bContext *C, struct KeyingSet *ks);
/* Flags for use by driver creation calls */
typedef enum eCreateDriverFlags {
- CREATEDRIVER_WITH_DEFAULT_DVAR = (1 << 0), /* create drivers with a default variable for nicer UI */
- CREATEDRIVER_WITH_FMODIFIER = (1 << 1), /* create drivers with Generator FModifier (for backwards compat) */
+ /** create drivers with a default variable for nicer UI */
+ CREATEDRIVER_WITH_DEFAULT_DVAR = (1 << 0),
+ /** create drivers with Generator FModifier (for backwards compat) */
+ CREATEDRIVER_WITH_FMODIFIER = (1 << 1),
} eCreateDriverFlags;
/* Heuristic to use for connecting target properties to driven ones */
typedef enum eCreateDriver_MappingTypes {
- CREATEDRIVER_MAPPING_1_N = 0, /* 1 to Many - Use the specified index, and drive all elements with it */
- CREATEDRIVER_MAPPING_1_1 = 1, /* 1 to 1 - Only for the specified index on each side */
- CREATEDRIVER_MAPPING_N_N = 2, /* Many to Many - Match up the indices one by one (only for drivers on vectors/arrays) */
-
- CREATEDRIVER_MAPPING_NONE = 3, /* None (Single Prop) - Do not create driver with any targets; these will get added later instead */
- CREATEDRIVER_MAPPING_NONE_ALL = 4, /* None (All Properties) - Do not create driver with any targets; these will get added later instead */
+ /** 1 to Many - Use the specified index, and drive all elements with it */
+ CREATEDRIVER_MAPPING_1_N = 0,
+ /** 1 to 1 - Only for the specified index on each side */
+ CREATEDRIVER_MAPPING_1_1 = 1,
+ /** Many to Many - Match up the indices one by one (only for drivers on vectors/arrays) */
+ CREATEDRIVER_MAPPING_N_N = 2,
+
+ /** None (Single Prop):
+ * Do not create driver with any targets; these will get added later instead */
+ CREATEDRIVER_MAPPING_NONE = 3,
+ /** None (All Properties):
+ * Do not create driver with any targets; these will get added later instead */
+ CREATEDRIVER_MAPPING_NONE_ALL = 4,
} eCreateDriver_MappingTypes;
/* RNA Enum of eCreateDriver_MappingTypes, for use by the appropriate operators */
diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h
index f674a0d87f9..0ff1ee4206e 100644
--- a/source/blender/editors/include/ED_numinput.h
+++ b/source/blender/editors/include/ED_numinput.h
@@ -33,20 +33,30 @@
struct wmEvent;
typedef struct NumInput {
- short idx_max; /* idx_max < NUM_MAX_ELEMENTS */
+ /** idx_max < NUM_MAX_ELEMENTS */
+ short idx_max;
int unit_sys;
- int unit_type[NUM_MAX_ELEMENTS]; /* Each value can have a different type */
+ /** Each value can have a different type */
+ int unit_type[NUM_MAX_ELEMENTS];
bool unit_use_radians;
- short flag; /* Flags affecting all values' behavior */
- short val_flag[NUM_MAX_ELEMENTS]; /* Per-value flags */
- float val[NUM_MAX_ELEMENTS]; /* Direct value of the input */
- float val_org[NUM_MAX_ELEMENTS]; /* Original value of the input, for reset */
- float val_inc[NUM_MAX_ELEMENTS]; /* Increment steps */
-
- short idx; /* Active element/value */
- char str[NUM_STR_REP_LEN]; /* String as typed by user for edited value (we assume ASCII world!) */
- /* Current position of cursor in edited value str (first byte of "current" letter, so 0 for an empty str) */
+ /** Flags affecting all values' behavior */
+ short flag;
+ /** Per-value flags */
+ short val_flag[NUM_MAX_ELEMENTS];
+ /** Direct value of the input */
+ float val[NUM_MAX_ELEMENTS];
+ /** Original value of the input, for reset */
+ float val_org[NUM_MAX_ELEMENTS];
+ /** Increment steps */
+ float val_inc[NUM_MAX_ELEMENTS];
+
+ /** Active element/value */
+ short idx;
+ /** String as typed by user for edited value (we assume ASCII world!) */
+ char str[NUM_STR_REP_LEN];
+ /** Current position of cursor in edited value str
+ * (first byte of "current" letter, so 0 for an empty str) */
int str_cur;
} NumInput;
diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h
index 288ee8a3598..5a02bc2310a 100644
--- a/source/blender/editors/include/ED_object.h
+++ b/source/blender/editors/include/ED_object.h
@@ -67,8 +67,10 @@ struct uiLayout;
#include "BLI_compiler_attrs.h"
/* object_edit.c */
-struct Object *ED_object_context(struct bContext *C); /* context.object */
-struct Object *ED_object_active_context(struct bContext *C); /* context.object or context.active_object */
+/* context.object */
+struct Object *ED_object_context(struct bContext *C);
+/* context.object or context.active_object */
+struct Object *ED_object_active_context(struct bContext *C);
void ED_collection_hide_menu_draw(const struct bContext *C, struct uiLayout *layout);
/* object_utils.c */
@@ -175,7 +177,8 @@ float ED_object_new_primitive_matrix(
const float loc[3], const float rot[3], float primmat[4][4]);
-/* Avoid allowing too much insane values even by typing (typos can hang/crash Blender otherwise). */
+/* Avoid allowing too much insane values even by typing
+ * (typos can hang/crash Blender otherwise). */
#define OBJECT_ADD_SIZE_MAXF 1.0e12f
void ED_object_add_unit_props_size(struct wmOperatorType *ot);
diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h
index 8ef7fee0f32..e53f303ea39 100644
--- a/source/blender/editors/include/ED_screen_types.h
+++ b/source/blender/editors/include/ED_screen_types.h
@@ -77,10 +77,18 @@ typedef struct ScreenFrameRateInfo {
/* Enum for Action Zone Edges. Which edge of area is action zone. */
typedef enum {
- AE_RIGHT_TO_TOPLEFT, /* Region located on the left, _right_ edge is action zone. Region minimized to the top left */
- AE_LEFT_TO_TOPRIGHT, /* Region located on the right, _left_ edge is action zone. Region minimized to the top right */
- AE_TOP_TO_BOTTOMRIGHT, /* Region located at the bottom, _top_ edge is action zone. Region minimized to the bottom right */
- AE_BOTTOM_TO_TOPLEFT /* Region located at the top, _bottom_ edge is action zone. Region minimized to the top left */
+ /** Region located on the left, _right_ edge is action zone.
+ * Region minimized to the top left */
+ AE_RIGHT_TO_TOPLEFT,
+ /** Region located on the right, _left_ edge is action zone.
+ * Region minimized to the top right */
+ AE_LEFT_TO_TOPRIGHT,
+ /** Region located at the bottom, _top_ edge is action zone.
+ * Region minimized to the bottom right */
+ AE_TOP_TO_BOTTOMRIGHT,
+ /** Region located at the top, _bottom_ edge is action zone.
+ * Region minimized to the top left */
+ AE_BOTTOM_TO_TOPLEFT
} AZEdge;
typedef enum {
diff --git a/source/blender/editors/include/ED_transverts.h b/source/blender/editors/include/ED_transverts.h
index 363bb31c3dc..e15514f8cd8 100644
--- a/source/blender/editors/include/ED_transverts.h
+++ b/source/blender/editors/include/ED_transverts.h
@@ -61,9 +61,12 @@ enum {
/* mode flags: */
enum {
- TM_ALL_JOINTS = (1 << 0), /* all joints (for bones only) */
- TM_SKIP_HANDLES = (1 << 1), /* skip handles when control point is selected (for curves only) */
- TM_CALC_NORMALS = (1 << 2), /* fill in normals when available */
+ /** all joints (for bones only) */
+ TM_ALL_JOINTS = (1 << 0),
+ /** skip handles when control point is selected (for curves only) */
+ TM_SKIP_HANDLES = (1 << 1),
+ /** fill in normals when available */
+ TM_CALC_NORMALS = (1 << 2),
};
enum {
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 748fb180c1a..b3c3a6a9840 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -155,11 +155,16 @@ void ED_view3d_depth_tag_update(struct RegionView3D *rv3d);
/* return values for ED_view3d_project_...() */
typedef enum {
V3D_PROJ_RET_OK = 0,
- V3D_PROJ_RET_CLIP_NEAR = 1, /* can't avoid this when in perspective mode, (can't avoid) */
- V3D_PROJ_RET_CLIP_ZERO = 2, /* so close to zero we can't apply a perspective matrix usefully */
- V3D_PROJ_RET_CLIP_BB = 3, /* bounding box clip - RV3D_CLIPPING */
- V3D_PROJ_RET_CLIP_WIN = 4, /* outside window bounds */
- V3D_PROJ_RET_OVERFLOW = 5 /* outside range (mainly for short), (can't avoid) */
+ /** can't avoid this when in perspective mode, (can't avoid) */
+ V3D_PROJ_RET_CLIP_NEAR = 1,
+ /** so close to zero we can't apply a perspective matrix usefully */
+ V3D_PROJ_RET_CLIP_ZERO = 2,
+ /** bounding box clip - RV3D_CLIPPING */
+ V3D_PROJ_RET_CLIP_BB = 3,
+ /** outside window bounds */
+ V3D_PROJ_RET_CLIP_WIN = 4,
+ /** outside range (mainly for short), (can't avoid) */
+ V3D_PROJ_RET_OVERFLOW = 5
} eV3DProjStatus;
/* some clipping tests are optional */
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 821f683cf6e..e0969ff07b8 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -539,7 +539,9 @@ typedef void (*uiBlockCancelFunc)(struct bContext *C, void *arg1);
void UI_popup_block_invoke(struct bContext *C, uiBlockCreateFunc func, void *arg);
void UI_popup_block_invoke_ex(struct bContext *C, uiBlockCreateFunc func, void *arg, const char *opname, int opcontext);
void UI_popup_block_ex(struct bContext *C, uiBlockCreateFunc func, uiBlockHandleFunc popup_func, uiBlockCancelFunc cancel_func, void *arg, struct wmOperator *op);
-/* void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext); */ /* UNUSED */
+#if 0 /* UNUSED */
+void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, int opcontext);
+#endif
void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block);
@@ -1254,13 +1256,19 @@ void uiItemsFullEnumO_items(
const EnumPropertyItem *item_array, int totitem);
void uiItemL(uiLayout *layout, const char *name, int icon); /* label */
-void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, const char *name, int icon); /* label icon for dragging */
-void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon); /* menu */
-void uiItemMContents(uiLayout *layout, const char *menuname); /* menu contents */
-void uiItemV(uiLayout *layout, const char *name, int icon, int argval); /* value */
-void uiItemS(uiLayout *layout); /* separator */
+/* label icon for dragging */
+void uiItemLDrag(uiLayout *layout, struct PointerRNA *ptr, const char *name, int icon);
+/* menu */
+void uiItemM(uiLayout *layout, const char *menuname, const char *name, int icon);
+/* menu contents */
+void uiItemMContents(uiLayout *layout, const char *menuname);
+/* value */
+void uiItemV(uiLayout *layout, const char *name, int icon, int argval);
+/* separator */
+void uiItemS(uiLayout *layout);
void uiItemS_ex(uiLayout *layout, float factor);
-void uiItemSpacer(uiLayout *layout); /* Special separator. */
+/* Special separator. */
+void uiItemSpacer(uiLayout *layout);
void uiItemPopoverPanel_ptr(
uiLayout *layout, struct bContext *C,
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c
index 7d82e8d2377..d60e2d0cdb6 100644
--- a/source/blender/editors/interface/interface.c
+++ b/source/blender/editors/interface/interface.c
@@ -164,7 +164,8 @@ void ui_block_to_window_rctf(const ARegion *ar, uiBlock *block, rctf *rct_dst, c
ui_block_to_window_fl(ar, block, &rct_dst->xmax, &rct_dst->ymax);
}
-void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y) /* for mouse cursor */
+/* for mouse cursor */
+void ui_window_to_block_fl(const ARegion *ar, uiBlock *block, float *x, float *y)
{
float a, b, c, d, e, f, px, py;
int sx, sy, getsizex, getsizey;
@@ -505,7 +506,8 @@ static void ui_block_bounds_calc_popup(
ui_block_bounds_calc(block);
/* If given, adjust input coordinates such that they would generate real final popup position.
- * Needed to handle correctly floating panels once they have been dragged around, see T52999. */
+ * Needed to handle correctly floating panels once they have been dragged around,
+ * see T52999. */
if (r_xy) {
r_xy[0] = xy[0] + block->rect.xmin - raw_x;
r_xy[1] = xy[1] + block->rect.ymin - raw_y;
@@ -1116,7 +1118,8 @@ static bool ui_but_event_property_operator_string(
/* Don't use the button again. */
but = NULL;
- /* this version is only for finding hotkeys for properties (which get set via context using operators) */
+ /* this version is only for finding hotkeys for properties
+ * (which get set via context using operators) */
if (prop) {
/* to avoid massive slowdowns on property panels, for now, we only check the
* hotkeys for Editor / Scene settings...
@@ -1327,7 +1330,8 @@ static void ui_menu_block_set_keymaps(const bContext *C, uiBlock *block)
continue;
}
else if (((block->flag & UI_BLOCK_POPOVER) == 0) && UI_but_is_tool(but)) {
- /* For non-popovers, shown in shortcut only (has special shortcut handling code). */
+ /* For non-popovers, shown in shortcut only
+ * (has special shortcut handling code). */
continue;
}
}
@@ -2090,7 +2094,8 @@ void ui_but_value_set(uiBut *but, double value)
case PROP_ENUM:
if (RNA_property_flag(prop) & PROP_ENUM_FLAG) {
int ivalue = (int)value;
- ivalue ^= RNA_property_enum_get(&but->rnapoin, prop); /* toggle for enum/flag buttons */
+ /* toggle for enum/flag buttons */
+ ivalue ^= RNA_property_enum_get(&but->rnapoin, prop);
RNA_property_enum_set(&but->rnapoin, prop, ivalue);
}
else {
@@ -2294,7 +2299,8 @@ static float ui_get_but_step_unit(uiBut *but, float step_default)
{
int unit_type = RNA_SUBTYPE_UNIT_VALUE(UI_but_unit_type_get(but));
const double step_orig = step_default * UI_PRECISION_FLOAT_SCALE;
- /* Scaling up 'step_origg ' here is a bit arbitrary, its just giving better scales from user POV */
+ /* Scaling up 'step_origg ' here is a bit arbitrary,
+ * its just giving better scales from user POV */
const double scale_step = ui_get_but_scale_unit(but, step_orig * 10);
const double step = bUnit_ClosestScalar(scale_step, but->block->unit->system, unit_type);
@@ -2514,7 +2520,8 @@ bool ui_but_string_set_eval_num(bContext *C, uiBut *but, const char *str, double
bool is_unit_but = (ui_but_is_float(but) && ui_but_is_unit(but));
/* only enable verbose if we won't run again with units */
if (BPY_execute_string_as_number(C, NULL, str, is_unit_but == false, r_value)) {
- /* if the value parsed ok without unit conversion this button may still need a unit multiplier */
+ /* if the value parsed ok without unit conversion
+ * this button may still need a unit multiplier */
if (is_unit_but) {
char str_new[128];
@@ -3569,7 +3576,8 @@ static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *bu
uiItemL(column, item->name, item->icon);
}
else {
- /* Do not use uiItemL here, as our root layout is a menu one, it will add a fake blank icon! */
+ /* Do not use uiItemL here, as our root layout is a menu one,
+ * it will add a fake blank icon! */
uiDefBut(block, UI_BTYPE_LABEL, 0, item->name, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "");
}
}
@@ -4588,7 +4596,8 @@ void UI_but_func_search_set(
uiButSearchFunc search_func, void *arg,
uiButHandleFunc bfunc, void *active)
{
- /* needed since callers don't have access to internal functions (as an alternative we could expose it) */
+ /* needed since callers don't have access to internal functions
+ * (as an alternative we could expose it) */
if (search_create_func == NULL) {
search_create_func = ui_searchbox_create_generic;
}
@@ -4637,7 +4646,8 @@ static void operator_enum_search_cb(const struct bContext *C, void *but, const c
RNA_property_enum_items_gettexted((bContext *)C, ptr, prop, &item_array, NULL, &do_free);
for (item = item_array; item->identifier; item++) {
- /* note: need to give the index rather than the identifier because the enum can be freed */
+ /* note: need to give the index rather than the
+ * identifier because the enum can be freed */
if (BLI_strcasestr(item->name, str)) {
if (false == UI_search_item_add(items, item->name, POINTER_FROM_INT(item->value), item->icon))
break;
diff --git a/source/blender/editors/interface/interface_align.c b/source/blender/editors/interface/interface_align.c
index d102c7c582d..488ee0fd003 100644
--- a/source/blender/editors/interface/interface_align.c
+++ b/source/blender/editors/interface/interface_align.c
@@ -42,22 +42,25 @@
#ifdef USE_UIBUT_SPATIAL_ALIGN
/**
- * This struct stores a (simplified) 2D representation of all buttons of a same align group, with their
- * immediate neighbors (if found), and needed value to compute 'stitching' of aligned buttons.
+ * This struct stores a (simplified) 2D representation of all buttons of a same align group,
+ * with their immediate neighbors (if found),
+ * and needed value to compute 'stitching' of aligned buttons.
*
- * \note This simplistic struct cannot fully represent complex layouts where buttons share some 'align space' with
- * several others (see schema below), we'd need linked list and more complex code to handle that.
- * However, looks like we can do without that for now, which is rather lucky!
+ * \note This simplistic struct cannot fully represent complex layouts where buttons share some
+ * 'align space' with several others (see schema below), we'd need linked list and more
+ * complex code to handle that. However, looks like we can do without that for now,
+ * which is rather lucky!
*
* <pre>
- * +-----------+-----------+
- * | BUT 1 | BUT 2 | BUT 3 has two 'top' neighbors...
- * |-----------------------| => In practice, we only store one of BUT 1 or 2 (which ones is not
- * | BUT 3 | really deterministic), and assume the other stores a ref to BUT 3.
- * +-----------------------+
+ * +--------+-------+
+ * | BUT 1 | BUT 2 | BUT 3 has two 'top' neighbors...
+ * |----------------| => In practice, we only store one of BUT 1 or 2 (which ones is not
+ * | BUT 3 | really deterministic), and assume the other stores a ref to BUT 3.
+ * +----------------+
* </pre>
*
- * This will probably not work in all possible cases, but not sure we want to support such exotic cases anyway.
+ * This will probably not work in all possible cases,
+ * but not sure we want to support such exotic cases anyway.
*/
typedef struct ButAlign {
uiBut *but;
@@ -71,13 +74,15 @@ typedef struct ButAlign {
/* Distances to the neighbors. */
float dists[4];
- /* Flags, used to mark whether we should 'stitch' the corners of this button with its neighbors' ones. */
+ /* Flags, used to mark whether we should 'stitch'
+ * the corners of this button with its neighbors' ones. */
char flags[4];
} ButAlign;
/* Side-related enums and flags. */
enum {
- /* Sides (used as indices, order is **crucial**, this allows us to factorize code in a loop over the four sides). */
+ /* Sides (used as indices, order is **crucial**,
+ * this allows us to factorize code in a loop over the four sides). */
LEFT = 0,
TOP = 1,
RIGHT = 2,
@@ -162,14 +167,17 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other
}
for (side = 0; side < RIGHT; side++) {
- /* We are only interested in buttons which share a same line (LEFT/RIGHT sides) or column (TOP/DOWN sides). */
+ /* We are only interested in buttons which share a same line
+ * (LEFT/RIGHT sides) or column (TOP/DOWN sides). */
if (buts_share[IS_COLUMN(side)]) {
side_opp = OPPOSITE(side);
- /* We check both opposite sides at once, because with very small buttons, delta could be below max_delta for
- * the wrong side (that is, in horizontal case, the total width of two buttons can be below max_delta).
- * We rely on exact zero value here as an 'already processed' flag, so ensure we never actually
- * set a zero value at this stage. FLT_MIN is zero-enough for UI position computing. ;) */
+ /* We check both opposite sides at once, because with very small buttons,
+ * delta could be below max_delta for the wrong side
+ * (that is, in horizontal case, the total width of two buttons can be below max_delta).
+ * We rely on exact zero value here as an 'already processed' flag,
+ * so ensure we never actually set a zero value at this stage.
+ * FLT_MIN is zero-enough for UI position computing. ;) */
delta = max_ff(fabsf(*butal->borders[side] - *butal_other->borders[side_opp]), FLT_MIN);
delta_side_opp = max_ff(fabsf(*butal->borders[side_opp] - *butal_other->borders[side]), FLT_MIN);
if (delta_side_opp < delta) {
@@ -178,18 +186,21 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other
}
if (delta < max_delta) {
- /* We are only interested in neighbors that are at least as close as already found ones. */
+ /* We are only interested in neighbors that are
+ * at least as close as already found ones. */
if (delta <= butal->dists[side]) {
{
/* We found an as close or closer neighbor.
* If both buttons are alignable, we set them as each other neighbors.
- * Else, we have an unalignable one, we need to reset the others matching neighbor to NULL
- * if its 'proximity distance' is really lower with current one.
+ * Else, we have an unalignable one, we need to reset the others matching
+ * neighbor to NULL if its 'proximity distance'
+ * is really lower with current one.
*
- * NOTE: We cannot only execute that piece of code in case we found a **closer** neighbor,
- * due to the limited way we represent neighbors (buttons only know **one** neighbor
- * on each side, when they can actually have several ones), it would prevent
- * some buttons to be properly 'neighborly-initialized'. */
+ * NOTE: We cannot only execute that piece of code in case we found a
+ * **closer** neighbor, due to the limited way we represent neighbors
+ * (buttons only know **one** neighbor on each side, when they can
+ * actually have several ones), it would prevent some buttons to be
+ * properly 'neighborly-initialized'. */
if (butal_can_align && butal_other_can_align) {
butal->neighbors[side] = butal_other;
butal_other->neighbors[side_opp] = butal;
@@ -217,10 +228,12 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other
butal_other->neighbors[side_opp] = butal;
}
- /* We have a pair of neighbors, we have to check whether we can stitch their matching corners.
+ /* We have a pair of neighbors, we have to check whether we
+ * can stitch their matching corners.
* E.g. if butal_other is on the left of butal (that is, side == LEFT),
- * if both TOP (side_s1) coordinates of buttons are close enough, we can stitch
- * their upper matching corners, and same for DOWN (side_s2) side. */
+ * if both TOP (side_s1) coordinates of buttons are close enough,
+ * we can stitch their upper matching corners,
+ * and same for DOWN (side_s2) side. */
delta = fabsf(*butal->borders[side_s1] - *butal_other->borders[side_s1]);
if (delta < max_delta) {
butal->flags[side_s1] |= stitch;
@@ -233,7 +246,8 @@ static void block_align_proximity_compute(ButAlign *butal, ButAlign *butal_other
}
}
}
- /* We assume two buttons can only share one side at most - for until we have sperical UI... */
+ /* We assume two buttons can only share one side at most - for until
+ * we have sperical UI... */
return;
}
}
@@ -329,9 +343,10 @@ static int ui_block_align_butal_cmp(const void *a, const void *b)
return (*butal->borders[LEFT] > *butal_other->borders[LEFT]) ? 1 : -1;
}
- /* XXX We cannot actually assert here, since in some very compressed space cases, stupid UI code produces
- * widgets which have the same TOP and LEFT positions...
- * We do not care really, because this happens when UI is way too small to be usable anyway. */
+ /* XXX We cannot actually assert here, since in some very compressed space cases,
+ * stupid UI code produces widgets which have the same TOP and LEFT positions...
+ * We do not care really,
+ * because this happens when UI is way too small to be usable anyway. */
/* BLI_assert(0); */
return 0;
}
@@ -423,27 +438,29 @@ void ui_block_align_calc(uiBlock *block, const ARegion *region)
}
/* This will give us ButAlign items regrouped by align group, vertical and horizontal location.
- * Note that, given how buttons are defined in UI code, butal_array shall already be "nearly sorted"... */
+ * Note that, given how buttons are defined in UI code,
+ * butal_array shall already be "nearly sorted"... */
qsort(butal_array, (size_t)num_buttons, sizeof(*butal_array), ui_block_align_butal_cmp);
- /* Third loop: for each pair of buttons in the same align group, we compute their potential proximity.
- * Note that each pair is checked only once, and that we break early in case we know all remaining pairs will
- * always be too far away. */
+ /* Third loop: for each pair of buttons in the same align group,
+ * we compute their potential proximity. Note that each pair is checked only once, and that we
+ * break early in case we know all remaining pairs will always be too far away. */
for (i = 0, butal = butal_array; i < num_buttons; i++, butal++) {
const short alignnr = butal->but->alignnr;
for (j = i + 1, butal_other = &butal_array[i + 1]; j < num_buttons; j++, butal_other++) {
const float max_delta = MAX_DELTA;
- /* Since they are sorted, buttons after current butal can only be of same or higher group, and once
- * they are not of same group, we know we can break this sub-loop and start checking with next butal. */
+ /* Since they are sorted, buttons after current butal can only be of same or higher
+ * group, and once they are not of same group, we know we can break this sub-loop and
+ * start checking with next butal. */
if (butal_other->but->alignnr != alignnr) {
break;
}
- /* Since they are sorted vertically first, buttons after current butal can only be at same or lower height,
- * and once they are lower than a given threshold, we know we can break this sub-loop and
- * start checking with next butal. */
+ /* Since they are sorted vertically first, buttons after current butal can only be at
+ * same or lower height, and once they are lower than a given threshold, we know we can
+ * break this sub-loop and start checking with next butal. */
if ((*butal->borders[DOWN] - *butal_other->borders[TOP]) > max_delta) {
break;
}
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index 4cd3acc7474..1ac5ce27b3e 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -216,7 +216,8 @@ bool ui_but_anim_expression_create(uiBut *but, const char *str)
}
/* make sure we have animdata for this */
- /* FIXME: until materials can be handled by depsgraph, don't allow drivers to be created for them */
+ /* FIXME: until materials can be handled by depsgraph,
+ * don't allow drivers to be created for them */
id = (ID *)but->rnapoin.id.data;
if ((id == NULL) || (GS(id->name) == ID_MA) || (GS(id->name) == ID_TE)) {
if (G.debug & G_DEBUG)
diff --git a/source/blender/editors/interface/interface_context_menu.c b/source/blender/editors/interface/interface_context_menu.c
index 5ac45580b18..f71715fa700 100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@ -54,7 +54,8 @@
#include "WM_api.h"
#include "WM_types.h"
-/* This hack is needed because we don't have a good way to re-reference keymap items once added: T42944 */
+/* This hack is needed because we don't have a good way to
+ * re-reference keymap items once added: T42944 */
#define USE_KEYMAP_ADD_HACK
/* -------------------------------------------------------------------- */
@@ -135,7 +136,8 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
int kmi_id;
- /* XXX this guess_opname can potentially return a different keymap than being found on adding later... */
+ /* XXX this guess_opname can potentially return a different keymap
+ * than being found on adding later... */
km = WM_keymap_guess_opname(C, but->optype->idname);
kmi = WM_keymap_add_item(km, but->optype->idname, AKEY, KM_PRESS, 0, 0);
kmi_id = kmi->id;
@@ -407,7 +409,8 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
bool is_idprop = RNA_property_is_idprop(prop);
bool is_set = RNA_property_is_set(ptr, prop);
- /* second slower test, saved people finding keyframe items in menus when its not possible */
+ /* second slower test,
+ * saved people finding keyframe items in menus when its not possible */
if (is_anim)
is_anim = RNA_property_path_from_ID_check(&but->rnapoin, but->rnaprop);
@@ -418,7 +421,8 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
const int override_status = RNA_property_static_override_status(ptr, prop, -1);
const bool is_overridable = (override_status & RNA_OVERRIDE_STATUS_OVERRIDABLE) != 0;
- /* Set the (button_pointer, button_prop) and pointer data for Python access to the hovered ui element. */
+ /* Set the (button_pointer, button_prop)
+ * and pointer data for Python access to the hovered ui element. */
uiLayoutSetContextFromBut(layout, but);
/* Keyframes */
@@ -675,7 +679,8 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but)
}
}
- /* Pointer properties and string properties with prop_search support jumping to target object/bone. */
+ /* Pointer properties and string properties with
+ * prop_search support jumping to target object/bone. */
if (but->rnapoin.data && but->rnaprop) {
const PropertyType type = RNA_property_type(but->rnaprop);
diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c
index ac1578d885d..dab8dd3d04b 100644
--- a/source/blender/editors/interface/interface_draw.c
+++ b/source/blender/editors/interface/interface_draw.c
@@ -547,7 +547,8 @@ void UI_draw_text_underline(int pos_x, int pos_y, int len, int height, const flo
/* ************** SPECIAL BUTTON DRAWING FUNCTIONS ************* */
-/* based on UI_draw_roundbox_gl_mode, check on making a version which allows us to skip some sides */
+/* based on UI_draw_roundbox_gl_mode,
+ * check on making a version which allows us to skip some sides */
void ui_draw_but_TAB_outline(const rcti *rect, float rad, uchar highlight[3], uchar highlight_fade[3])
{
GPUVertFormat *format = immVertexFormat();
@@ -892,7 +893,8 @@ void ui_draw_but_WAVEFORM(ARegion *UNUSED(ar), uiBut *but, const uiWidgetColors
int scissor[4];
float colors[3][3];
float colorsycc[3][3] = {{1, 0, 1}, {1, 1, 0}, {0, 1, 1}};
- float colors_alpha[3][3], colorsycc_alpha[3][3]; /* colors pre multiplied by alpha for speed up */
+ /* colors pre multiplied by alpha for speed up */
+ float colors_alpha[3][3], colorsycc_alpha[3][3];
float min, max;
if (scopes == NULL) return;
diff --git a/source/blender/editors/interface/interface_eyedropper_datablock.c b/source/blender/editors/interface/interface_eyedropper_datablock.c
index 781032ef971..33d69524b77 100644
--- a/source/blender/editors/interface/interface_eyedropper_datablock.c
+++ b/source/blender/editors/interface/interface_eyedropper_datablock.c
@@ -114,7 +114,8 @@ static int datadropper_init(bContext *C, wmOperator *op)
type = RNA_property_pointer_type(&ddr->ptr, ddr->prop);
ddr->idcode = RNA_type_to_ID_code(type);
BLI_assert(ddr->idcode != 0);
- /* Note we can translate here (instead of on draw time), because this struct has very short lifetime. */
+ /* Note we can translate here (instead of on draw time),
+ * because this struct has very short lifetime. */
ddr->idcode_name = TIP_(BKE_idcode_to_name(ddr->idcode));
PointerRNA ptr = RNA_property_pointer_get(&ddr->ptr, ddr->prop);
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index e037692e3e8..86cc51712a9 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -229,10 +229,14 @@ typedef struct uiButMultiState {
typedef struct uiHandleButtonMulti {
enum {
- BUTTON_MULTI_INIT_UNSET = 0, /* gesture direction unknown, wait until mouse has moved enough... */
- BUTTON_MULTI_INIT_SETUP, /* vertical gesture detected, flag buttons interactively (UI_BUT_DRAG_MULTI) */
- BUTTON_MULTI_INIT_ENABLE, /* flag buttons finished, apply horizontal motion to active and flagged */
- BUTTON_MULTI_INIT_DISABLE, /* vertical gesture _not_ detected, take no further action */
+ /** gesture direction unknown, wait until mouse has moved enough... */
+ BUTTON_MULTI_INIT_UNSET = 0,
+ /** vertical gesture detected, flag buttons interactively (UI_BUT_DRAG_MULTI) */
+ BUTTON_MULTI_INIT_SETUP,
+ /** flag buttons finished, apply horizontal motion to active and flagged */
+ BUTTON_MULTI_INIT_ENABLE,
+ /** vertical gesture _not_ detected, take no further action */
+ BUTTON_MULTI_INIT_DISABLE,
} init;
bool has_mbuts; /* any buttons flagged UI_BUT_DRAG_MULTI */
@@ -241,11 +245,12 @@ typedef struct uiHandleButtonMulti {
bool is_proportional;
- /* In some cases we directly apply the changes to multiple buttons, so we don't want to do it twice. */
+ /* In some cases we directly apply the changes to multiple buttons,
+ * so we don't want to do it twice. */
bool skip;
- /* before activating, we need to check gesture direction
- * accumulate signed cursor movement here so we can tell if this is a vertical motion or not. */
+ /* before activating, we need to check gesture direction accumulate signed cursor movement
+ * here so we can tell if this is a vertical motion or not. */
float drag_dir[2];
/* values copied direct from event->x,y
@@ -323,8 +328,10 @@ typedef struct uiHandleButtonData {
CBData *dragcbd;
#ifdef USE_CONT_MOUSE_CORRECT
- /* when ungrabbing buttons which are #ui_but_is_cursor_warp(), we may want to position them
- * FLT_MAX signifies do-nothing, use #ui_block_to_window_fl() to get this into a usable space */
+ /* when ungrabbing buttons which are #ui_but_is_cursor_warp(),
+ * we may want to position them.
+ * FLT_MAX signifies do-nothing, use #ui_block_to_window_fl()
+ * to get this into a usable space. */
float ungrab_mval[2];
#endif
@@ -1335,7 +1342,8 @@ static void ui_drag_toggle_set(bContext *C, uiDragToggleHandle *drag_info, const
BLI_rctf_cent_y(&but->rect),
};
- /* check if this is a different button, chances are high the button wont move about :) */
+ /* check if this is a different button,
+ * chances are high the button wont move about :) */
if (len_manhattan_v2v2(drag_info->but_cent_start, but_cent_new) > 1.0f) {
if (fabsf(drag_info->but_cent_start[0] - but_cent_new[0]) <
fabsf(drag_info->but_cent_start[1] - but_cent_new[1]))
@@ -1596,18 +1604,22 @@ static void ui_selectcontext_apply(
RNA_property_int_range(&but->rnapoin, prop, &min.i, &max.i);
}
else if (rna_type == PROP_ENUM) {
- delta.i = RNA_property_enum_get(&but->rnapoin, prop); /* not a delta infact */
+ /* not a delta infact */
+ delta.i = RNA_property_enum_get(&but->rnapoin, prop);
}
else if (rna_type == PROP_BOOLEAN) {
if (is_array) {
- delta.b = RNA_property_boolean_get_index(&but->rnapoin, prop, index); /* not a delta infact */
+ /* not a delta infact */
+ delta.b = RNA_property_boolean_get_index(&but->rnapoin, prop, index);
}
else {
- delta.b = RNA_property_boolean_get(&but->rnapoin, prop); /* not a delta infact */
+ /* not a delta infact */
+ delta.b = RNA_property_boolean_get(&but->rnapoin, prop);
}
}
else if (rna_type == PROP_POINTER) {
- delta.p = RNA_property_pointer_get(&but->rnapoin, prop); /* not a delta infact */
+ /* not a delta infact */
+ delta.p = RNA_property_pointer_get(&but->rnapoin, prop);
}
#ifdef USE_ALLSELECT_LAYER_HACK
@@ -3244,7 +3256,8 @@ static void ui_do_but_textedit(
{
bool had_selection = but->selsta != but->selend;
- /* exit on LMB only on RELEASE for searchbox, to mimic other popups, and allow multiple menu levels */
+ /* exit on LMB only on RELEASE for searchbox, to mimic other popups,
+ * and allow multiple menu levels */
if (data->searchbox)
inbox = ui_searchbox_inside(data->searchbox, event->x, event->y);
@@ -3282,7 +3295,8 @@ static void ui_do_but_textedit(
changed = true;
}
else if (inbox) {
- /* if we allow activation on key press, it gives problems launching operators [#35713] */
+ /* if we allow activation on key press,
+ * it gives problems launching operators T35713. */
if (event->val == KM_RELEASE) {
button_activate_state(C, but, BUTTON_STATE_EXIT);
retval = WM_UI_HANDLER_BREAK;
@@ -3741,7 +3755,8 @@ static bool ui_do_but_ANY_drag_toggle(
}
}
else if (data->state == BUTTON_STATE_WAIT_DRAG) {
- /* note: the 'BUTTON_STATE_WAIT_DRAG' part of 'ui_do_but_EXIT' could be refactored into its own function */
+ /* note: the 'BUTTON_STATE_WAIT_DRAG' part of 'ui_do_but_EXIT' could be refactored into
+ * its own function */
data->applied = false;
*r_retval = ui_do_but_EXIT(C, but, data, event);
return true;
@@ -4312,7 +4327,8 @@ static bool ui_numedit_but_NUM(
float non_linear_pixel_map;
float non_linear_scale;
- /* Use a non-linear mapping of the mouse drag especially for large floats (normal behavior) */
+ /* Use a non-linear mapping of the mouse drag especially for large floats
+ * (normal behavior) */
deler = 500;
if (is_float) {
/* not needed for smaller float buttons */
@@ -4454,8 +4470,10 @@ static int ui_do_but_NUM(
}
/* XXX hardcoded keymap check.... */
- if (type == MOUSEPAN && event->alt)
- retval = WM_UI_HANDLER_BREAK; /* allow accumulating values, otherwise scrolling gets preference */
+ if (type == MOUSEPAN && event->alt) {
+ /* allow accumulating values, otherwise scrolling gets preference */
+ retval = WM_UI_HANDLER_BREAK;
+ }
else if (type == WHEELDOWNMOUSE && event->ctrl) {
mx = but->rect.xmin;
but->drawflag &= ~UI_BUT_ACTIVE_RIGHT;
@@ -4756,8 +4774,10 @@ static int ui_do_but_SLI(
}
/* XXX hardcoded keymap check.... */
- if (type == MOUSEPAN && event->alt)
- retval = WM_UI_HANDLER_BREAK; /* allow accumulating values, otherwise scrolling gets preference */
+ if (type == MOUSEPAN && event->alt) {
+ /* allow accumulating values, otherwise scrolling gets preference */
+ retval = WM_UI_HANDLER_BREAK;
+ }
else if (type == WHEELDOWNMOUSE && event->ctrl) {
mx = but->rect.xmin;
click = 2;
@@ -4772,7 +4792,8 @@ static int ui_do_but_SLI(
retval = WM_UI_HANDLER_BREAK;
}
#ifndef USE_ALLSELECT
- /* alt-click on sides to get "arrows" like in UI_BTYPE_NUM buttons, and match wheel usage above */
+ /* alt-click on sides to get "arrows" like in UI_BTYPE_NUM buttons,
+ * and match wheel usage above */
else if (event->type == LEFTMOUSE && event->alt) {
int halfpos = BLI_rctf_cent_x(&but->rect);
click = 2;
@@ -4877,7 +4898,8 @@ static int ui_do_but_SLI(
#if 0
if (but->type == SLI) {
- f = (float)(mx - but->rect.xmin) / (BLI_rctf_size_x(&but->rect)); /* same as below */
+ /* same as below */
+ f = (float)(mx - but->rect.xmin) / (BLI_rctf_size_x(&but->rect));
}
else
#endif
@@ -6108,7 +6130,8 @@ static bool ui_numedit_but_CURVE(
int a;
bool changed = false;
- /* evtx evty and drag coords are absolute mousecoords, prevents errors when editing when layout changes */
+ /* evtx evty and drag coords are absolute mousecoords,
+ * prevents errors when editing when layout changes */
mx = evtx;
my = evty;
ui_window_to_block(data->region, block, &mx, &my);
@@ -6277,7 +6300,8 @@ static int ui_do_but_CURVE(
changed = true;
- /* reset cmp back to the curve points again, rather than drawing segments */
+ /* reset cmp back to the curve points again,
+ * rather than drawing segments */
cmp = cuma->curve;
/* find newly added point and make it 'sel' */
@@ -7197,7 +7221,8 @@ void UI_but_tooltip_refresh(bContext *C, uiBut *but)
}
}
-/* removes tooltip timer from active but (meaning tooltip is disabled until it's reenabled again) */
+/* removes tooltip timer from active but
+ * (meaning tooltip is disabled until it's reenabled again) */
void UI_but_tooltip_timer_remove(bContext *C, uiBut *but)
{
uiHandleButtonData *data;
@@ -8005,7 +8030,8 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
uiBut *but_other = ui_but_find_mouse_over(ar, event);
bool exit = false;
- /* always deactivate button for pie menus, else moving to blank space will leave activated */
+ /* always deactivate button for pie menus,
+ * else moving to blank space will leave activated */
if ((!ui_block_is_menu(block) || ui_block_is_pie_menu(block)) &&
!ui_but_contains_point_px(ar, but, event->x, event->y))
{
@@ -8041,7 +8067,8 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but)
break;
}
- /* XXX hardcoded keymap check... but anyway, while view changes, tooltips should be removed */
+ /* XXX hardcoded keymap check... but anyway,
+ * while view changes, tooltips should be removed */
case WHEELUPMOUSE:
case WHEELDOWNMOUSE:
case MIDDLEMOUSE:
@@ -8267,7 +8294,8 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *ar,
}
if (dyn_data->items_filter_neworder || dyn_data->items_filter_flags) {
- /* If we have a display order different from collection order, we have some work! */
+ /* If we have a display order different from
+ * collection order, we have some work! */
int *org_order = MEM_mallocN(dyn_data->items_shown * sizeof(int), __func__);
const int *new_order = dyn_data->items_filter_neworder;
int i, org_idx = -1, len = dyn_data->items_len;
@@ -9053,7 +9081,8 @@ static int ui_handle_menu_event(
}
}
else if (ELEM(event->val, KM_RELEASE, KM_CLICK)) {
- /* For buttons that use a hold function, exit when mouse-up outside the menu. */
+ /* For buttons that use a hold function,
+ * exit when mouse-up outside the menu. */
if (block->flag & UI_BLOCK_POPUP_HOLD) {
/* Note, we could check the cursor is over the parent button. */
menu->menuretval = UI_RETURN_CANCEL;
@@ -9306,7 +9335,8 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
bool is_click_style;
float dist;
- /* we block all events, this is modal interaction, except for drop events which is described below */
+ /* we block all events, this is modal interaction,
+ * except for drop events which is described below */
int retval = WM_UI_HANDLER_BREAK;
if (event->type == EVT_DROP) {
@@ -9455,7 +9485,8 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle
block->pie_data.flags |= UI_PIE_DRAG_STYLE;
}
- /* here instead, we use the offset location to account for the initial direction timeout */
+ /* here instead, we use the offset location to account for the initial
+ * direction timeout */
if ((U.pie_menu_confirm > 0) &&
(dist >= U.dpi_fac * (U.pie_menu_threshold + U.pie_menu_confirm)))
{
@@ -9573,7 +9604,8 @@ static int ui_handle_menus_recursive(
uiBlock *block = menu->region->uiblocks.first;
const bool is_menu = ui_block_is_menu(block);
bool inside = false;
- /* root pie menus accept the key that spawned them as double click to improve responsiveness */
+ /* root pie menus accept the key that spawned
+ * them as double click to improve responsiveness */
bool do_recursion = (!(block->flag & UI_BLOCK_RADIAL) || event->type != block->pie_data.event);
if (do_recursion) {
@@ -9773,7 +9805,8 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void *UNUSE
data = but->active;
if ((data->state == BUTTON_STATE_MENU_OPEN) &&
- (is_inside_menu == false) && /* make sure mouse isn't inside another menu (see T43247) */
+ /* make sure mouse isn't inside another menu (see T43247) */
+ (is_inside_menu == false) &&
(ELEM(but->type, UI_BTYPE_PULLDOWN, UI_BTYPE_POPOVER)) &&
(but_other = ui_but_find_mouse_over(ar, event)) &&
(but != but_other) &&
@@ -9837,7 +9870,8 @@ static int ui_popup_handler(bContext *C, const wmEvent *event, void *userdata)
{
uiPopupBlockHandle *menu = userdata;
struct ARegion *menu_region;
- /* we block all events, this is modal interaction, except for drop events which is described below */
+ /* we block all events, this is modal interaction,
+ * except for drop events which is described below */
int retval = WM_UI_HANDLER_BREAK;
bool reset_pie = false;
diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c
index eb35f69b627..f3bb61cdd3d 100644
--- a/source/blender/editors/interface/interface_icons.c
+++ b/source/blender/editors/interface/interface_icons.c
@@ -709,7 +709,10 @@ static void init_internal_icons(void)
if (icondir) {
BLI_join_dirfile(iconfilestr, sizeof(iconfilestr), icondir, btheme->tui.iconfile);
- bbuf = IMB_loadiffname(iconfilestr, IB_rect, NULL); /* if the image is missing bbuf will just be NULL */
+
+ /* if the image is missing bbuf will just be NULL */
+ bbuf = IMB_loadiffname(iconfilestr, IB_rect, NULL);
+
if (bbuf && (bbuf->x < ICON_IMAGE_W || bbuf->y < ICON_IMAGE_H)) {
printf("\n***WARNING***\nIcons file %s too small.\nUsing built-in Icons instead\n", iconfilestr);
IMB_freeImBuf(bbuf);
@@ -1520,7 +1523,8 @@ static void icon_draw_size(
}
else if (di->type == ICON_TYPE_GEOM) {
#ifdef USE_UI_TOOLBAR_HACK
- /* TODO(campbell): scale icons up for toolbar, we need a way to detect larger buttons and do this automatic. */
+ /* TODO(campbell): scale icons up for toolbar,
+ * we need a way to detect larger buttons and do this automatic. */
{
float scale = (float)ICON_DEFAULT_HEIGHT_TOOLBAR / (float)ICON_DEFAULT_HEIGHT;
y = (y + (h / 2)) - ((h * scale) / 2);
@@ -1615,7 +1619,8 @@ static void icon_draw_size(
static void ui_id_preview_image_render_size(
const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job)
{
- if (((pi->flag[size] & PRV_CHANGED) || !pi->rect[size])) { /* changed only ever set by dynamic icons */
+ /* changed only ever set by dynamic icons */
+ if (((pi->flag[size] & PRV_CHANGED) || !pi->rect[size])) {
/* create the rect if necessary */
icon_set_image(C, scene, id, pi, size, use_job);
@@ -1628,10 +1633,14 @@ void UI_id_icon_render(const bContext *C, Scene *scene, ID *id, const bool big,
PreviewImage *pi = BKE_previewimg_id_ensure(id);
if (pi) {
- if (big)
- ui_id_preview_image_render_size(C, scene, id, pi, ICON_SIZE_PREVIEW, use_job); /* bigger preview size */
- else
- ui_id_preview_image_render_size(C, scene, id, pi, ICON_SIZE_ICON, use_job); /* icon size */
+ if (big) {
+ /* bigger preview size */
+ ui_id_preview_image_render_size(C, scene, id, pi, ICON_SIZE_PREVIEW, use_job);
+ }
+ else {
+ /* icon size */
+ ui_id_preview_image_render_size(C, scene, id, pi, ICON_SIZE_ICON, use_job);
+ }
}
}
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 0a69ff6e38b..20671ae8162 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -106,7 +106,8 @@ typedef enum {
} uiWidgetTypeEnum;
#define UI_MENU_WIDTH_MIN (UI_UNIT_Y * 9)
-#define UI_MENU_SUBMENU_PADDING (6 * UI_DPI_FAC) /* some extra padding added to menus containing submenu icons */
+/* some extra padding added to menus containing submenu icons */
+#define UI_MENU_SUBMENU_PADDING (6 * UI_DPI_FAC)
/* menu scrolling */
#define UI_MENU_SCROLL_ARROW 12
@@ -181,13 +182,20 @@ extern const short ui_radial_dir_to_angle[8];
/* PieMenuData->flags */
enum {
- UI_PIE_DEGREES_RANGE_LARGE = (1 << 0), /* pie menu item collision is detected at 90 degrees */
- UI_PIE_INITIAL_DIRECTION = (1 << 1), /* use initial center of pie menu to calculate direction */
- UI_PIE_DRAG_STYLE = (1 << 2), /* pie menu is drag style */
- UI_PIE_INVALID_DIR = (1 << 3), /* mouse not far enough from center position */
- UI_PIE_CLICK_STYLE = (1 << 4), /* pie menu changed to click style, click to confirm */
- UI_PIE_ANIMATION_FINISHED = (1 << 5), /* pie animation finished, do not calculate any more motion */
- UI_PIE_GESTURE_END_WAIT = (1 << 6), /* pie gesture selection has been done, now wait for mouse motion to end */
+ /** pie menu item collision is detected at 90 degrees */
+ UI_PIE_DEGREES_RANGE_LARGE = (1 << 0),
+ /** use initial center of pie menu to calculate direction */
+ UI_PIE_INITIAL_DIRECTION = (1 << 1),
+ /** pie menu is drag style */
+ UI_PIE_DRAG_STYLE = (1 << 2),
+ /** mouse not far enough from center position */
+ UI_PIE_INVALID_DIR = (1 << 3),
+ /** pie menu changed to click style, click to confirm */
+ UI_PIE_CLICK_STYLE = (1 << 4),
+ /** pie animation finished, do not calculate any more motion */
+ UI_PIE_ANIMATION_FINISHED = (1 << 5),
+ /** pie gesture selection has been done, now wait for mouse motion to end */
+ UI_PIE_GESTURE_END_WAIT = (1 << 6),
};
#define PIE_CLICK_THRESHOLD_SQ 50.0f
@@ -256,7 +264,7 @@ struct uiBut {
void *rename_arg1;
void *rename_orig;
- /* Run an action when holding the button down. */
+ /** Run an action when holding the button down. */
uiButHandleHoldFunc hold_func;
void *hold_argN;
@@ -264,14 +272,18 @@ struct uiBut {
uiButToolTipFunc tip_func;
void *tip_argN;
- /* info on why button is disabled, displayed in tooltip */
+ /** info on why button is disabled, displayed in tooltip */
const char *disabled_info;
BIFIconID icon;
- char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied from the block */
- signed char pie_dir; /* direction in a pie menu, used for collision detection (RadialDirection) */
- bool changed; /* could be made into a single flag */
- uchar unit_type; /* so buttons can support unit systems which are not RNA */
+ /** drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied from the block */
+ char dt;
+ /** direction in a pie menu, used for collision detection (RadialDirection) */
+ signed char pie_dir;
+ /** could be made into a single flag */
+ bool changed;
+ /** so buttons can support unit systems which are not RNA */
+ uchar unit_type;
short modifier_key;
short iconadd;
@@ -336,7 +348,7 @@ typedef struct ColorPickerData {
} ColorPickerData;
struct PieMenuData {
- /* store title and icon to allow access when pie levels are created */
+ /** store title and icon to allow access when pie levels are created */
const char *title;
int icon;
@@ -346,13 +358,14 @@ struct PieMenuData {
float last_pos[2];
double duration_gesture;
int flags;
- int event; /* initial event used to fire the pie menu, store here so we can query for release */
+ /** initial event used to fire the pie menu, store here so we can query for release */
+ int event;
float alphafac;
};
/* uiBlock.content_hints */
enum eBlockContentHints {
- /* In a menu block, if there is a single sub-menu button, we add some
+ /** In a menu block, if there is a single sub-menu button, we add some
* padding to the right to put nicely aligned triangle icons there. */
UI_BLOCK_CONTAINS_SUBMENU_BUT = (1 << 0),
};
@@ -403,14 +416,16 @@ struct uiBlock {
int flag;
short alignnr;
- /* Hints about the buttons of this block. Used to avoid iterating over
+ /** Hints about the buttons of this block. Used to avoid iterating over
* buttons to find out if some criteria is met by any. Instead, check this
* criteria when adding the button and set a flag here if it's met. */
short content_hints; /* eBlockContentHints */
char direction;
- char theme_style; /* UI_BLOCK_THEME_STYLE_* */
- char dt; /* drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied to buttons */
+ /** UI_BLOCK_THEME_STYLE_* */
+ char theme_style;
+ /** drawtype: UI_EMBOSS, UI_EMBOSS_NONE ... etc, copied to buttons */
+ char dt;
bool auto_open;
char _pad[5];
double auto_open_last;
@@ -418,32 +433,46 @@ struct uiBlock {
const char *lockstr;
char lock;
- char active; /* to keep blocks while drawing and free them afterwards */
- char tooltipdisabled; /* to avoid tooltip after click */
- char endblock; /* UI_block_end done? */
-
- eBlockBoundsCalc bounds_type; /* for doing delayed */
+ /** to keep blocks while drawing and free them afterwards */
+ char active;
+ /** to avoid tooltip after click */
+ char tooltipdisabled;
+ /** UI_block_end done? */
+ char endblock;
+
+ /** for doing delayed */
+ eBlockBoundsCalc bounds_type;
int mx, my;
- int bounds, minbounds; /* for doing delayed */
+ /** for doing delayed */
+ int bounds, minbounds;
- rctf safety; /* pulldowns, to detect outside, can differ per case how it is created */
- ListBase saferct; /* uiSafetyRct list */
+ /** pulldowns, to detect outside, can differ per case how it is created */
+ rctf safety;
+ /** uiSafetyRct list */
+ ListBase saferct;
uiPopupBlockHandle *handle; /* handle */
- struct wmOperator *ui_operator; /* use so presets can find the operator, */
- /* across menus and from nested popups which fail for operator context. */
+ /** use so presets can find the operator,
+ * across menus and from nested popups which fail for operator context. */
+ struct wmOperator *ui_operator;
- void *evil_C; /* XXX hack for dynamic operator enums */
+ /** XXX hack for dynamic operator enums */
+ void *evil_C;
- struct UnitSettings *unit; /* unit system, used a lot for numeric buttons so include here rather then fetching through the scene every time. */
- ColorPickerData color_pickers; /* XXX, only accessed by color picker templates */
+ /** unit system, used a lot for numeric buttons so include here
+ * rather then fetching through the scene every time. */
+ struct UnitSettings *unit;
+ /** \note only accessed by color picker templates. */
+ ColorPickerData color_pickers;
bool is_color_gamma_picker; /* Block for color picker with gamma baked in. */
- char display_device[64]; /* display device name used to display this block,
- * used by color widgets to transform colors from/to scene linear
- */
+ /** display device name used to display this block,
+ * used by color widgets to transform colors from/to scene linear
+ */
+ char display_device[64];
+
struct PieMenuData pie_data;
};
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index 09033a5f56d..6cd2ba0b924 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -158,7 +158,7 @@ struct uiLayout {
bContextStore *context;
ListBase items;
- /* Sub layout to add child items, if not the layout itself. */
+ /** Sub layout to add child items, if not the layout itself. */
uiLayout *child_items_layout;
int x, y, w, h;
@@ -169,10 +169,12 @@ struct uiLayout {
bool enabled;
bool redalert;
bool keepaspect;
- bool variable_size; /* For layouts inside gridflow, they and their items shall never have a fixed maximal size. */
+ /** For layouts inside gridflow, they and their items shall never have a fixed maximal size. */
+ bool variable_size;
char alignment;
char emboss;
- float units[2]; /* for fixed width or height to avoid UI size changes */
+ /** for fixed width or height to avoid UI size changes */
+ float units[2];
};
typedef struct uiLayoutItemFlow {
@@ -188,9 +190,12 @@ typedef struct uiLayoutItemGridFlow {
bool row_major; /* Fill first row first, instead of filling first column first. */
bool even_columns; /* Same width for all columns. */
bool even_rows; /* Same height for all rows. */
- /* If positive, absolute fixed number of columns.
- * If 0, fully automatic (based on available width).
- * If negative, automatic but only generates number of columns/rows multiple of given (absolute) value. */
+ /**
+ * - If positive, absolute fixed number of columns.
+ * - If 0, fully automatic (based on available width).
+ * - If negative, automatic but only generates number of columns/rows
+ * multiple of given (absolute) value.
+ */
int columns_len;
/* Pure internal runtime storage. */
@@ -274,8 +279,9 @@ static int ui_layout_vary_direction(uiLayout *layout)
static bool ui_layout_variable_size(uiLayout *layout)
{
- /* Note that this code is probably a bit flacky, we'd probably want to know whether it's variable in X and/or Y,
- * etc. But for now it mimics previous one, with addition of variable flag set for children of gridflow layouts. */
+ /* Note that this code is probably a bit flacky, we'd probably want to know whether it's
+ * variable in X and/or Y, etc. But for now it mimics previous one,
+ * with addition of variable flag set for children of gridflow layouts. */
return ui_layout_vary_direction(layout) == UI_ITEM_VARY_X || layout->variable_size;
}
@@ -697,7 +703,8 @@ static void ui_item_enum_expand_exec(
/* Separate items, potentially with a label. */
if (next_item->identifier) {
- /* Item without identifier but with name: Add group label for the following items. */
+ /* Item without identifier but with name:
+ * Add group label for the following items. */
if (item->name) {
if (!is_first) {
uiItemS(block->curlayout);
@@ -735,7 +742,8 @@ static void ui_item_enum_expand_exec(
if (uiLayoutGetLocalDir(layout) != UI_LAYOUT_HORIZONTAL)
but->drawflag |= UI_BUT_TEXT_LEFT;
- /* Allow quick, inaccurate swipe motions to switch tabs (no need to keep cursor over them). */
+ /* Allow quick, inaccurate swipe motions to switch tabs
+ * (no need to keep cursor over them). */
if (but_type == UI_BTYPE_TAB) {
but->flag |= UI_BUT_DRAG_LOCK;
}
@@ -806,7 +814,8 @@ static uiBut *ui_item_with_label(
}
else {
if (ui_layout_variable_size(layout)) {
- /* w_hint is width for label in this case. Use a default width for property button(s) */
+ /* w_hint is width for label in this case.
+ * Use a default width for property button(s) */
prop_but_width = UI_UNIT_X * 5;
w_label = w_hint;
}
@@ -1253,7 +1262,8 @@ void uiItemsFullEnumO_items(
but = block->buttons.last;
}
else {
- /* Do not use uiItemL here, as our root layout is a menu one, it will add a fake blank icon! */
+ /* Do not use uiItemL here, as our root layout is a menu one,
+ * it will add a fake blank icon! */
but = uiDefBut(
block, UI_BTYPE_LABEL, 0, item->name, 0, 0, UI_UNIT_X * 5, UI_UNIT_Y, NULL,
0.0, 0.0, 0, 0, "");
@@ -1262,7 +1272,8 @@ void uiItemsFullEnumO_items(
}
else {
if (radial) {
- /* invisible dummy button to ensure all items are always at the same position */
+ /* invisible dummy button to ensure all items are
+ * always at the same position */
uiItemS(target);
}
else {
@@ -1751,7 +1762,8 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
if ((type == PROP_ENUM) && (flag & UI_ITEM_R_EXPAND)) {
/* Expanded enums each have their own name. */
- /* Often expanded enum's are better arranged into a row, so check the existing layout. */
+ /* Often expanded enum's are better arranged into a row,
+ * so check the existing layout. */
if (uiLayoutGetLocalDir(layout) == UI_LAYOUT_HORIZONTAL) {
layout = uiLayoutRow(layout_split, true);
}
@@ -2106,7 +2118,8 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN
but->free_search_arg = true;
}
else if (but->type == UI_BTYPE_SEARCH_MENU) {
- /* In case we fail to find proper searchprop, so other code might have already set but->type to search menu... */
+ /* In case we fail to find proper searchprop,
+ * so other code might have already set but->type to search menu... */
but->flag |= UI_BUT_DISABLED;
}
}
@@ -2262,7 +2275,8 @@ static uiBut *ui_item_menu(
}
if (ELEM(layout->root->type, UI_LAYOUT_PANEL, UI_LAYOUT_TOOLBAR) ||
- (force_menu && layout->root->type != UI_LAYOUT_MENU)) /* We never want a dropdown in menu! */
+ /* We never want a dropdown in menu! */
+ (force_menu && layout->root->type != UI_LAYOUT_MENU))
{
UI_but_type_set_menu_from_pulldown(but);
}
@@ -3182,7 +3196,8 @@ typedef struct UILayoutGridFlowInput {
const bool even_rows : 1; /* All rows will have same height. */
const int space_x; /* Space between columns. */
const int space_y; /* Space between rows. */
- /* Real data about current position and size of this layout item (either estimated, or final values). */
+ /* Real data about current position and size of this layout item
+ * (either estimated, or final values). */
const int litem_w; /* Layout item width. */
const int litem_x; /* Layout item X position. */
const int litem_y; /* Layout item Y position. */
@@ -3430,7 +3445,8 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem)
}
}
- /* Set evenly-spaced axes size (quick optimization in case we have even columns and rows). */
+ /* Set evenly-spaced axes size
+ * (quick optimization in case we have even columns and rows). */
if (gflow->even_columns && gflow->even_rows) {
litem->w = (int)(gflow->tot_columns * avg_w) + space_x * (gflow->tot_columns - 1);
litem->h = (int)(gflow->tot_rows * max_h) + space_y * (gflow->tot_rows - 1);
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index 484debf554c..31ae3bc7b4b 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -444,7 +444,8 @@ static int override_type_set_button_exec(bContext *C, wmOperator *op)
operation = IDOVERRIDESTATIC_OP_REPLACE;
break;
case UIOverride_Type_Difference:
- operation = IDOVERRIDESTATIC_OP_ADD; /* override code will automatically switch to subtract if needed. */
+ /* override code will automatically switch to subtract if needed. */
+ operation = IDOVERRIDESTATIC_OP_ADD;
break;
case UIOverride_Type_Factor:
operation = IDOVERRIDESTATIC_OP_MULTIPLY;
@@ -549,13 +550,15 @@ static int override_remove_button_exec(bContext *C, wmOperator *op)
if (!all && index != -1) {
bool is_strict_find;
- /* Remove override operation for given item, add singular operations for the other items as needed. */
+ /* Remove override operation for given item,
+ * add singular operations for the other items as needed. */
IDOverrideStaticPropertyOperation *opop = BKE_override_static_property_operation_find(
oprop, NULL, NULL, index, index, false, &is_strict_find);
BLI_assert(opop != NULL);
if (!is_strict_find) {
/* No specific override operation, we have to get generic one,
- * and create item-specific override operations for all but given index, before removing generic one. */
+ * and create item-specific override operations for all but given index,
+ * before removing generic one. */
for (int idx = RNA_property_array_length(&ptr, prop); idx--; ) {
if (idx != index) {
BKE_override_static_property_operation_get(oprop, opop->operation, NULL, NULL, idx, idx, true, NULL, NULL);
@@ -735,7 +738,8 @@ bool UI_context_copy_to_selected_list(
}
else if (GS(id->name) == ID_SCE) {
/* Sequencer's ID is scene :/ */
- /* Try to recursively find an RNA_Sequence ancestor, to handle situations like T41062... */
+ /* Try to recursively find an RNA_Sequence ancestor,
+ * to handle situations like T41062... */
if ((*r_path = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Sequence)) != NULL) {
*r_lb = CTX_data_collection_get(C, "selected_editable_sequences");
}
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index c53aadefc20..1720eec8277 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -28,7 +28,8 @@
*/
-/* a full doc with API notes can be found in bf-blender/trunk/blender/doc/guides/interface_API.txt */
+/* a full doc with API notes can be found in
+ * bf-blender/trunk/blender/doc/guides/interface_API.txt */
#include <math.h>
#include <stdlib.h>
@@ -1872,8 +1873,10 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active)
const int px_x_sign = is_left ? px : -px;
const int category_tabs_width = round_fl_to_int(UI_PANEL_CATEGORY_MARGIN_WIDTH * zoom);
const float dpi_fac = UI_DPI_FAC;
- const int tab_v_pad_text = round_fl_to_int((2 + ((px * 3) * dpi_fac)) * zoom); /* padding of tabs around text */
- const int tab_v_pad = round_fl_to_int((4 + (2 * px * dpi_fac)) * zoom); /* padding between tabs */
+ /* padding of tabs around text */
+ const int tab_v_pad_text = round_fl_to_int((2 + ((px * 3) * dpi_fac)) * zoom);
+ /* padding between tabs */
+ const int tab_v_pad = round_fl_to_int((4 + (2 * px * dpi_fac)) * zoom);
const float tab_curve_radius = ((px * 3) * dpi_fac) * zoom;
/* We flip the tab drawing, so always use these flags. */
const int roundboxtype = UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT;
@@ -2153,7 +2156,8 @@ static int ui_handle_panel_category_cycling(const wmEvent *event, ARegion *ar, c
const bool backwards = event->shift;
pc_dyn = backwards ? pc_dyn->prev : pc_dyn->next;
if (!pc_dyn) {
- /* proper cyclic behavior, back to first/last category (only used for ctrl+tab) */
+ /* proper cyclic behavior,
+ * back to first/last category (only used for ctrl+tab) */
pc_dyn = backwards ? ar->panels_category.last : ar->panels_category.first;
}
}
@@ -2225,10 +2229,13 @@ int ui_handler_panel_region(bContext *C, const wmEvent *event, ARegion *ar, cons
/* checks for mouse position inside */
pa = block->panel;
- if (!pa || pa->paneltab != NULL)
+ if (!pa || pa->paneltab != NULL) {
continue;
- if (pa->type && pa->type->flag & PNL_NO_HEADER) /* XXX - accessed freed panels when scripts reload, need to fix. */
+ }
+ /* XXX - accessed freed panels when scripts reload, need to fix. */
+ if (pa->type && pa->type->flag & PNL_NO_HEADER) {
continue;
+ }
mouse_state = ui_panel_mouse_state_get(block, pa, mx, my);
diff --git a/source/blender/editors/interface/interface_region_color_picker.c b/source/blender/editors/interface/interface_region_color_picker.c
index 819fbc874d3..b084d66d6c6 100644
--- a/source/blender/editors/interface/interface_region_color_picker.c
+++ b/source/blender/editors/interface/interface_region_color_picker.c
@@ -175,7 +175,8 @@ static void ui_update_color_picker_buts_rgb(
}
ui_rgb_to_color_picker_compat_v(tmp, hsv);
- /* this updates button strings, is hackish... but button pointers are on stack of caller function */
+ /* this updates button strings,
+ * is hackish... but button pointers are on stack of caller function */
for (bt = block->buttons.first; bt; bt = bt->next) {
if (bt->custom_data != cpicker)
continue;
@@ -193,7 +194,8 @@ static void ui_update_color_picker_buts_rgb(
double intpart;
char col[16];
- /* Hex code is assumed to be in sRGB space (coming from other applications, web, etc) */
+ /* Hex code is assumed to be in sRGB space
+ * (coming from other applications, web, etc) */
copy_v3_v3(rgb_hex, rgb);
if (from_but && !ui_but_is_color_gamma(from_but)) {
IMB_colormanagement_scene_linear_to_srgb_v3(rgb_hex);
diff --git a/source/blender/editors/interface/interface_region_menu_pie.c b/source/blender/editors/interface/interface_region_menu_pie.c
index 44effc8c097..eae2b01d370 100644
--- a/source/blender/editors/interface/interface_region_menu_pie.c
+++ b/source/blender/editors/interface/interface_region_menu_pie.c
@@ -126,7 +126,8 @@ uiPieMenu *UI_pie_menu_begin(struct bContext *C, const char *title, int icon, co
pie->block_radial->puphash = ui_popup_menu_hash(title);
pie->block_radial->flag |= UI_BLOCK_RADIAL;
- /* if pie is spawned by a left click, release or click event, it is always assumed to be click style */
+ /* if pie is spawned by a left click, release or click event,
+ * it is always assumed to be click style */
if (event->type == LEFTMOUSE || ELEM(event->val, KM_RELEASE, KM_CLICK)) {
pie->block_radial->pie_data.flags |= UI_PIE_CLICK_STYLE;
pie->block_radial->pie_data.event = EVENT_NONE;
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c
index e136614d30e..da5bd3062e6 100644
--- a/source/blender/editors/interface/interface_region_menu_popup.c
+++ b/source/blender/editors/interface/interface_region_menu_popup.c
@@ -393,7 +393,8 @@ uiPopupMenu *UI_popup_menu_begin_ex(bContext *C, const char *title, const char *
pup->layout = UI_block_layout(pup->block, UI_LAYOUT_VERTICAL, UI_LAYOUT_MENU, 0, 0, 200, 0, MENU_PADDING, style);
/* note, this intentionally differs from the menu & submenu default because many operators
- * use popups like this to select one of their options - where having invoke doesn't make sense */
+ * use popups like this to select one of their options -
+ * where having invoke doesn't make sense */
uiLayoutSetOperatorContext(pup->layout, WM_OP_EXEC_REGION_WIN);
/* create in advance so we can let buttons point to retval already */
@@ -640,7 +641,8 @@ void UI_popup_block_close(bContext *C, wmWindow *win, uiBlock *block)
UI_popup_handlers_remove(&win->modalhandlers, block->handle);
ui_popup_block_free(C, block->handle);
- /* In the case we have nested popups, closing one may need to redraw another, see: T48874 */
+ /* In the case we have nested popups,
+ * closing one may need to redraw another, see: T48874 */
for (ARegion *ar = screen->regionbase.first; ar; ar = ar->next) {
ED_region_tag_refresh_ui(ar);
}
diff --git a/source/blender/editors/interface/interface_region_popover.c b/source/blender/editors/interface/interface_region_popover.c
index cb4939adc56..e5607f6d7aa 100644
--- a/source/blender/editors/interface/interface_region_popover.c
+++ b/source/blender/editors/interface/interface_region_popover.c
@@ -165,7 +165,8 @@ static uiBlock *ui_block_func_POPOVER(bContext *C, uiPopupBlockHandle *handle, v
if (!handle->refresh) {
float center[2] = {BLI_rctf_cent_x(&pup->but->rect), BLI_rctf_cent_y(&pup->but->rect)};
ui_block_to_window_fl(handle->ctx_region, pup->but->block, &center[0], &center[1]);
- /* These variables aren't used for popovers, we could add new variables if there is a conflict. */
+ /* These variables aren't used for popovers,
+ * we could add new variables if there is a conflict. */
handle->prev_mx = block->mx = (int)center[0];
handle->prev_my = block->my = (int)center[1];
}
diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index d6e1fcdea24..9091bb1c3d9 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -90,10 +90,14 @@ typedef struct uiSearchboxData {
rcti bbox;
uiFontStyle fstyle;
uiSearchItems items;
- int active; /* index in items array */
- bool noback; /* when menu opened with enough space for this */
- bool preview; /* draw thumbnail previews, rather than list */
- bool use_sep; /* use the UI_SEP_CHAR char for splitting shortcuts (good for operators, bad for data) */
+ /** index in items array */
+ int active;
+ /** when menu opened with enough space for this */
+ bool noback;
+ /** draw thumbnail previews, rather than list */
+ bool preview;
+ /** use the UI_SEP_CHAR char for splitting shortcuts (good for operators, bad for data) */
+ bool use_sep;
int prv_rows, prv_cols;
} uiSearchboxData;
@@ -262,7 +266,8 @@ bool ui_searchbox_apply(uiBut *but, ARegion *ar)
return true;
}
else if (but->flag & UI_BUT_VALUE_CLEAR) {
- /* It is valid for _VALUE_CLEAR flavor to have no active element (it's a valid way to unlink). */
+ /* It is valid for _VALUE_CLEAR flavor to have no active element
+ * (it's a valid way to unlink). */
but->editstr[0] = '\0';
return true;
diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c
index 94bed87b40b..b4df8d237e0 100644
--- a/source/blender/editors/interface/interface_style.c
+++ b/source/blender/editors/interface/interface_style.c
@@ -520,7 +520,8 @@ void uiStyleInit(void)
}
#endif
- /* XXX, this should be moved into a style, but for now best only load the monospaced font once. */
+ /* XXX, this should be moved into a style,
+ * but for now best only load the monospaced font once. */
BLI_assert(blf_mono_font == -1);
if (U.font_path_ui_mono[0]) {
blf_mono_font = BLF_load_unique(U.font_path_ui_mono);
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 7cf68a144b2..ed3e2e863b7 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -129,8 +129,12 @@ static void template_add_button_search_menu(
ARegion *region = CTX_wm_region(C);
ScrArea *area = CTX_wm_area(C);
/* XXX ugly top-bar exception */
- const bool use_big_size = (region->regiontype != RGN_TYPE_HEADER) && (area->spacetype != SPACE_TOPBAR); /* silly check, could be more generic */
- /* Ugly exception for screens here, drawing their preview in icon size looks ugly/useless */
+ const bool use_big_size = (
+ /* silly check, could be more generic */
+ (region->regiontype != RGN_TYPE_HEADER) &&
+ (area->spacetype != SPACE_TOPBAR));
+ /* Ugly exception for screens here,
+ * drawing their preview in icon size looks ugly/useless */
const bool use_preview_icon = use_big_size || (id && (GS(id->name) != ID_SCR));
const short width = UI_UNIT_X * (use_big_size ? 6 : 1.6f);
const short height = UI_UNIT_Y * (use_big_size ? 6 : 1);
@@ -1048,7 +1052,9 @@ void uiTemplateAnyID(
}
/* Start drawing UI Elements using standard defines */
- split = uiLayoutSplit(layout, 0.33f, false); /* NOTE: split amount here needs to be synced with normal labels */
+
+ /* NOTE: split amount here needs to be synced with normal labels */
+ split = uiLayoutSplit(layout, 0.33f, false);
/* FIRST PART ................................................ */
row = uiLayoutRow(split, false);
@@ -1066,14 +1072,20 @@ void uiTemplateAnyID(
row = uiLayoutRow(split, true);
/* ID-Type Selector - just have a menu of icons */
- sub = uiLayoutRow(row, true); /* HACK: special group just for the enum, otherwise we */
- uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT); /* we get ugly layout with text included too... */
+
+ /* HACK: special group just for the enum,
+ * otherwise we get ugly layout with text included too... */
+ sub = uiLayoutRow(row, true);
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
uiItemFullR(sub, ptr, propType, 0, 0, UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
/* ID-Block Selector - just use pointer widget... */
- sub = uiLayoutRow(row, true); /* HACK: special group to counteract the effects of the previous */
- uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_EXPAND); /* enum, which now pushes everything too far right */
+
+ /* HACK: special group to counteract the effects of the previous enum,
+ * which now pushes everything too far right. */
+ sub = uiLayoutRow(row, true);
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_EXPAND);
uiItemFullR(sub, ptr, propID, 0, 0, 0, "", ICON_NONE);
}
@@ -1312,7 +1324,8 @@ void uiTemplatePathBuilder(
/* Path (existing string) Widget */
uiItemR(row, ptr, propname, 0, text, ICON_RNA);
- /* TODO: attach something to this to make allow searching of nested properties to 'build' the path */
+ /* TODO: attach something to this to make allow
+ * searching of nested properties to 'build' the path */
}
/************************ Modifier Template *************************/
@@ -1350,7 +1363,8 @@ static int modifier_can_delete(ModifierData *md)
return 1;
}
-/* Check whether Modifier is a simulation or not, this is used for switching to the physics/particles context tab */
+/* Check whether Modifier is a simulation or not,
+ * this is used for switching to the physics/particles context tab */
static int modifier_is_simulation(ModifierData *md)
{
/* Physic Tab */
@@ -1477,7 +1491,8 @@ static uiLayout *draw_modifier(
UI_block_align_end(block);
UI_block_emboss_set(block, UI_EMBOSS_NONE);
- /* When Modifier is a simulation, show button to switch to context rather than the delete button. */
+ /* When Modifier is a simulation,
+ * show button to switch to context rather than the delete button. */
if (modifier_can_delete(md) &&
!modifier_is_simulation(md))
{
@@ -1542,7 +1557,8 @@ static uiLayout *draw_modifier(
}
}
- /* result is the layout block inside the box, that we return so that modifier settings can be drawn */
+ /* result is the layout block inside the box,
+ * that we return so that modifier settings can be drawn */
result = uiLayoutColumn(box, false);
block = uiLayoutAbsoluteBlock(box);
}
@@ -1679,7 +1695,8 @@ static uiLayout *gpencil_draw_modifier(
uiItemO(row, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Copy"), ICON_NONE,
"OBJECT_OT_gpencil_modifier_copy");
- /* result is the layout block inside the box, that we return so that modifier settings can be drawn */
+ /* result is the layout block inside the box,
+ * that we return so that modifier settings can be drawn */
result = uiLayoutColumn(box, false);
block = uiLayoutAbsoluteBlock(box);
}
@@ -1797,7 +1814,8 @@ static uiLayout *gpencil_draw_shaderfx(
/* only here obdata, the rest of effect is ob level */
UI_block_lock_set(block, BKE_object_obdata_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
- /* result is the layout block inside the box, that we return so that effect settings can be drawn */
+ /* result is the layout block inside the box,
+ * that we return so that effect settings can be drawn */
result = uiLayoutColumn(box, false);
block = uiLayoutAbsoluteBlock(box);
}
@@ -2022,7 +2040,8 @@ static uiLayout *draw_constraint(uiLayout *layout, Object *ob, bConstraint *con)
if (proxy_protected) {
UI_block_emboss_set(block, UI_EMBOSS_NONE);
- /* draw a ghost icon (for proxy) and also a lock beside it, to show that constraint is "proxy locked" */
+ /* draw a ghost icon (for proxy) and also a lock beside it,
+ * to show that constraint is "proxy locked" */
uiDefIconBut(block, UI_BTYPE_BUT, B_CONSTRAINT_TEST, ICON_GHOST_ENABLED, xco + 12.2f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Proxy Protected"));
uiDefIconBut(block, UI_BTYPE_BUT, B_CONSTRAINT_TEST, ICON_LOCKED, xco + 13.1f * UI_UNIT_X, yco, 0.95f * UI_UNIT_X, 0.95f * UI_UNIT_Y,
@@ -3057,7 +3076,8 @@ static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v)
rna_update_cb(C, cb_v, NULL);
}
-/* still unsure how this call evolves... we use labeltype for defining what curve-channels to show */
+/* still unsure how this call evolves...
+ * we use labeltype for defining what curve-channels to show */
static void curvemap_buttons_layout(
uiLayout *layout, PointerRNA *ptr, char labeltype, bool levels,
bool brush, bool neg_slope, bool tone, RNAUpdateCb *cb)
@@ -3756,7 +3776,8 @@ static void uilist_prepare(
rows = min_ii(dyn_data->height, maxrows);
}
- /* If list length changes or list is tagged to check this, and active is out of view, scroll to it .*/
+ /* If list length changes or list is tagged to check this,
+ * and active is out of view, scroll to it .*/
if (ui_list->list_last_len != len || ui_list->flag & UILST_SCROLL_TO_ACTIVE_ITEM) {
if (activei_row < ui_list->list_scroll) {
ui_list->list_scroll = activei_row;
@@ -4397,7 +4418,8 @@ eAutoPropButsReturn uiTemplateOperatorPropertyButs(
/* menu */
if (op->type->flag & OPTYPE_PRESET) {
- /* XXX, no simple way to get WM_MT_operator_presets.bl_label from python! Label remains the same always! */
+ /* XXX, no simple way to get WM_MT_operator_presets.bl_label
+ * from python! Label remains the same always! */
PointerRNA op_ptr;
uiLayout *row;
@@ -4868,7 +4890,8 @@ void uiTemplateKeymapItemProperties(uiLayout *layout, PointerRNA *ptr)
if (but->rnaprop) {
UI_but_func_set(but, keymap_item_modified, ptr->data, NULL);
- /* Otherwise the keymap will be re-generated which we're trying to edit, see: T47685 */
+ /* Otherwise the keymap will be re-generated which we're trying to edit,
+ * see: T47685 */
UI_but_flag_enable(but, UI_BUT_UPDATE_DELAY);
}
}
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index a7787d14776..5d262509e34 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -278,7 +278,8 @@ void ui_rna_collection_search_cb(const struct bContext *C, void *arg, const char
iconid = ui_id_icon_get(C, itemptr.data, false);
}
else {
- name = RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL); /* could use the string length here */
+ /* could use the string length here */
+ name = RNA_struct_name_get_alloc(&itemptr, NULL, 0, NULL);
}
if (name) {
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index fcb995d089c..a531306f667 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -368,7 +368,8 @@ GPUBatch *ui_batch_roundbox_widget_get(int tria)
set_roundbox_vertex_data(&vflag_step, last_data);
set_roundbox_vertex(&vflag_step, 0, 0, 0, false, false, EMBOSS);
/* Emboss */
- bool rev = false; /* go back and forth : avoid degenerate triangle (but beware of backface cull) */
+ /* go back and forth : avoid degenerate triangle (but beware of backface cull) */
+ bool rev = false;
for (int j = 0; j < WIDGET_AA_JITTER; j++, rev = !rev) {
for (int c = (rev) ? 1 : 0; (rev) ? c >= 0 : c < 2; (rev) ? c-- : c++) {
int sta = (rev) ? WIDGET_CURVE_RESOLU - 1 : 0;
@@ -685,7 +686,8 @@ static void round_box__edges(uiWidgetBase *wt, int roundboxalign, const rcti *re
float maxxi = maxx - U.pixelsize;
float minyi = miny + U.pixelsize;
float maxyi = maxy - U.pixelsize;
- float facxi = (maxxi != minxi) ? 1.0f / (maxxi - minxi) : 0.0f; /* for uv, can divide by zero */
+ /* for uv, can divide by zero */
+ float facxi = (maxxi != minxi) ? 1.0f / (maxxi - minxi) : 0.0f;
float facyi = (maxyi != minyi) ? 1.0f / (maxyi - minyi) : 0.0f;
int a, tot = 0, minsize;
const int hnum = (
@@ -1448,7 +1450,8 @@ float UI_text_clip_middle_ex(
float strwidth;
/* Add some epsilon to OK width, avoids 'ellipsing' text that nearly fits!
- * Better to have a small piece of the last char cut out, than two remaining chars replaced by an ellipsis... */
+ * Better to have a small piece of the last char cut out,
+ * than two remaining chars replaced by an ellipsis... */
okwidth += 1.0f + UI_DPI_FAC;
BLI_assert(str[0]);
@@ -1463,7 +1466,8 @@ float UI_text_clip_middle_ex(
strwidth = BLF_width(fstyle->uifont_id, str, max_len);
if ((okwidth > 0.0f) && (strwidth > okwidth)) {
- /* utf8 two-dots leader '..' (shorter than ellipsis '...'), some compilers complain with real litteral string. */
+ /* utf8 two-dots leader '..' (shorter than ellipsis '...'),
+ * some compilers complain with real litteral string. */
const char sep[] = {0xe2, 0x80, 0xA5, 0x0};
const int sep_len = sizeof(sep) - 1;
const float sep_strwidth = BLF_width(fstyle->uifont_id, sep, sep_len + 1);
@@ -1527,7 +1531,8 @@ float UI_text_clip_middle_ex(
else {
memmove(str + l_end + sep_len, str + r_offset, r_len);
memcpy(str + l_end, sep, sep_len);
- final_lpart_len = (size_t)(l_end + sep_len + r_len - 1); /* -1 to remove trailing '\0'! */
+ /* -1 to remove trailing '\0'! */
+ final_lpart_len = (size_t)(l_end + sep_len + r_len - 1);
while (BLF_width(fstyle->uifont_id, str, max_len) > okwidth) {
/* This will happen because a lot of string width processing is done in integer pixels,
@@ -1690,7 +1695,8 @@ static void ui_text_clip_right_label(const uiFontStyle *fstyle, uiBut *but, cons
const char *prev_utf8 = BLI_str_find_prev_char_utf8(but->drawstr, cp2);
int bytes = cp2 - prev_utf8;
- /* shift the text after and including cp2 back by 1 char, +1 to include null terminator */
+ /* shift the text after and including cp2 back by 1 char,
+ * +1 to include null terminator */
memmove(cp2 - bytes, cp2, drawstr_len + 1);
cp2 -= bytes;
@@ -2323,7 +2329,8 @@ static void widget_state(uiWidgetType *wt, int state, int drawflag)
static void widget_state_numslider(uiWidgetType *wt, int state, int drawflag)
{
uiWidgetStateColors *wcol_state = wt->wcol_state;
- float blend = wcol_state->blend - 0.2f; /* XXX special tweak to make sure that bar will still be visible */
+ /* XXX special tweak to make sure that bar will still be visible */
+ float blend = wcol_state->blend - 0.2f;
/* call this for option button */
widget_state(wt, state, drawflag);
@@ -2756,7 +2763,9 @@ void ui_draw_gradient(const rcti *rect, const float hsv[3], const int type, cons
immBindBuiltinProgram(GPU_SHADER_2D_SMOOTH_COLOR);
immBegin(GPU_PRIM_TRIS, steps * 3 * 6);
- for (dx = 0.0f; dx < 0.999f; dx += color_step) { /* 0.999 = prevent float inaccuracy for steps */
+
+ /* 0.999 = prevent float inaccuracy for steps */
+ for (dx = 0.0f; dx < 0.999f; dx += color_step) {
const float dx_next = dx + color_step;
/* previous color */
@@ -3366,7 +3375,8 @@ static void widget_numslider(uiBut *but, uiWidgetColors *wcol, rcti *rect, int s
wtb.draw_inner = false;
widgetbase_draw(&wtb, wcol);
- /* Add space at either side of the button so text aligns with numbuttons (which have arrow icons). */
+ /* Add space at either side of the button so text aligns with numbuttons
+ * (which have arrow icons). */
if (!(state & UI_STATE_TEXT_INPUT)) {
rect->xmax -= toffs;
rect->xmin += toffs;
@@ -3763,7 +3773,8 @@ static void widget_tab(uiWidgetColors *wcol, rcti *rect, int state, int roundbox
const float rad = wcol->roundness * U.widget_unit;
const bool is_active = (state & UI_SELECT);
-/* Draw shaded outline - Disabled for now, seems incorrect and also looks nicer without it imho ;) */
+/* Draw shaded outline - Disabled for now,
+ * seems incorrect and also looks nicer without it imho ;) */
//#define USE_TAB_SHADED_HIGHLIGHT
uiWidgetBase wtb;
@@ -4252,7 +4263,8 @@ void ui_draw_but(const bContext *C, ARegion *ar, uiStyle *style, uiBut *but, rct
break;
case UI_BTYPE_HSVCUBE:
- if (ELEM(but->a1, UI_GRAD_V_ALT, UI_GRAD_L_ALT)) { /* vertical V slider, uses new widget draw now */
+ if (ELEM(but->a1, UI_GRAD_V_ALT, UI_GRAD_L_ALT)) {
+ /* vertical V slider, uses new widget draw now */
ui_draw_but_HSV_v(but, rect);
}
else { /* other HSV pickers... */
@@ -4745,7 +4757,8 @@ void ui_draw_menu_item(const uiFontStyle *fstyle, rcti *rect, const char *name,
aspect = ICON_DEFAULT_HEIGHT / height;
GPU_blend(true);
- UI_icon_draw_aspect(xs, ys, iconid, aspect, 1.0f, wt->wcol.text); /* XXX scale weak get from fstyle? */
+ /* XXX scale weak get from fstyle? */
+ UI_icon_draw_aspect(xs, ys, iconid, aspect, 1.0f, wt->wcol.text);
GPU_blend(false);
}
}
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 3aadfeb5321..3f8f09d1f9f 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -236,7 +236,8 @@ const uchar *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colorid)
case TH_HEADER:
cp = ts->header; break;
case TH_HEADERDESEL:
- /* we calculate a dynamic builtin header deselect color, also for pulldowns... */
+ /* we calculate a dynamic builtin header deselect color,
+ * also for pulldowns... */
cp = ts->header;
headerdesel[0] = cp[0] > 10 ? cp[0] - 10 : 0;
headerdesel[1] = cp[1] > 10 ? cp[1] - 10 : 0;
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 6352dacad80..fb8e7e8d68f 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -234,7 +234,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
*/
case V2D_COMMONVIEW_STANDARD:
{
- /* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
+ /* for now, aspect ratio should be maintained,
+ * and zoom is clamped within sane default limits */
v2d->keepzoom = (V2D_KEEPASPECT | V2D_LIMITZOOM);
v2d->minzoom = 0.01f;
v2d->maxzoom = 1000.0f;
@@ -289,7 +290,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
/* scroller settings are currently not set here... that is left for regions... */
break;
}
- /* 'header' regions - zoom, aspect ratio, alignment, and panning restrictions are set here */
+ /* 'header' regions - zoom, aspect ratio,
+ * alignment, and panning restrictions are set here */
case V2D_COMMONVIEW_HEADER:
{
/* zoom + aspect ratio are locked */
@@ -322,7 +324,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
case V2D_COMMONVIEW_PANELS_UI:
{
- /* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */
+ /* for now, aspect ratio should be maintained,
+ * and zoom is clamped within sane default limits */
v2d->keepzoom = (V2D_KEEPASPECT | V2D_LIMITZOOM | V2D_KEEPZOOM);
v2d->minzoom = 0.5f;
v2d->maxzoom = 2.0f;
@@ -357,7 +360,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
}
/* other view types are completely defined using their own settings already */
default:
- /* we don't do anything here, as settings should be fine, but just make sure that rect */
+ /* we don't do anything here,
+ * as settings should be fine, but just make sure that rect */
break;
}
@@ -377,7 +381,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
}
/* set 'tot' rect before setting cur? */
- /* XXX confusing stuff here still - I made this function not check scroller hide - that happens in totrect_set */
+ /* XXX confusing stuff here still -
+ * I made this function not check scroller hide - that happens in totrect_set */
if (tot_changed)
UI_view2d_totRect_set_resize(v2d, winx, winy, !do_init);
else
@@ -486,7 +491,8 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas
}
}
else {
- /* make sure sizes don't exceed that of the min/max sizes (even though we're not doing zoom clamping) */
+ /* make sure sizes don't exceed that of the min/max sizes
+ * (even though we're not doing zoom clamping) */
CLAMP(width, v2d->min[0], v2d->max[0]);
CLAMP(height, v2d->min[1], v2d->max[1]);
}
@@ -576,7 +582,8 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas
v2d->oldwiny = (short)winy;
}
- /* Step 2: apply new sizes to cur rect, but need to take into account alignment settings here... */
+ /* Step 2: apply new sizes to cur rect,
+ * but need to take into account alignment settings here... */
if ((width != curwidth) || (height != curheight)) {
float temp, dh;
@@ -675,7 +682,8 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas
* (XXX - in the past, max was favored... if there are bugs, swap!)
*/
if ((cur->xmin < tot->xmin) && (cur->xmax > tot->xmax)) {
- /* outside boundaries on both sides, so take middle-point of tot, and place in balanced way */
+ /* outside boundaries on both sides,
+ * so take middle-point of tot, and place in balanced way */
temp = BLI_rctf_cent_x(tot);
diff = curwidth * 0.5f;
@@ -725,7 +733,8 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, bool resize, bool mas
* We favour moving the 'minimum' across, as that's origin for most things
*/
if ((cur->ymin < tot->ymin) && (cur->ymax > tot->ymax)) {
- /* outside boundaries on both sides, so take middle-point of tot, and place in balanced way */
+ /* outside boundaries on both sides,
+ * so take middle-point of tot, and place in balanced way */
temp = BLI_rctf_cent_y(tot);
diff = curheight * 0.5f;
@@ -803,7 +812,8 @@ void UI_view2d_curRect_validate(View2D *v2d)
/* ------------------ */
-/* Called by menus to activate it, or by view2d operators to make sure 'related' views stay in synchrony */
+/* Called by menus to activate it, or by view2d operators
+ * to make sure 'related' views stay in synchrony */
void UI_view2d_sync(bScreen *screen, ScrArea *area, View2D *v2dcur, int flag)
{
ScrArea *sa;
@@ -992,7 +1002,8 @@ void UI_view2d_totRect_set(View2D *v2d, int width, int height)
UI_view2d_totRect_set_resize(v2d, width, height, 0);
- /* solve bad recursion... if scroller state changed, mask is different, so you get different rects */
+ /* solve bad recursion... if scroller state changed,
+ * mask is different, so you get different rects */
if (scroll != view2d_scroll_mapped(v2d->scroll)) {
UI_view2d_totRect_set_resize(v2d, width, height, 0);
}
@@ -1072,7 +1083,8 @@ static void view2d_map_cur_using_mask(View2D *v2d, rctf *curmasked)
float sizex = BLI_rcti_size_x(&v2d->mask);
float sizey = BLI_rcti_size_y(&v2d->mask);
- /* prevent tiny or narrow regions to get invalid coordinates - mask can get negative even... */
+ /* prevent tiny or narrow regions to get
+ * invalid coordinates - mask can get negative even... */
if (sizex > 0.0f && sizey > 0.0f) {
float dx = BLI_rctf_size_x(&v2d->cur) / (sizex + 1);
float dy = BLI_rctf_size_y(&v2d->cur) / (sizey + 1);
@@ -1109,7 +1121,8 @@ void UI_view2d_view_ortho(View2D *v2d)
if (sizey > 0)
yofs = eps * BLI_rctf_size_y(&v2d->cur) / sizey;
- /* apply mask-based adjustments to cur rect (due to scrollers), to eliminate scaling artifacts */
+ /* apply mask-based adjustments to cur rect (due to scrollers),
+ * to eliminate scaling artifacts */
view2d_map_cur_using_mask(v2d, &curmasked);
BLI_rctf_translate(&curmasked, -xofs, -yofs);
@@ -1145,7 +1158,8 @@ void UI_view2d_view_orthoSpecial(ARegion *ar, View2D *v2d, const bool xaxis)
xofs = 0.0f; // (v2d->flag & V2D_PIXELOFS_X) ? GLA_PIXEL_OFS : 0.0f;
yofs = 0.0f; // (v2d->flag & V2D_PIXELOFS_Y) ? GLA_PIXEL_OFS : 0.0f;
- /* apply mask-based adjustments to cur rect (due to scrollers), to eliminate scaling artifacts */
+ /* apply mask-based adjustments to cur rect (due to scrollers),
+ * to eliminate scaling artifacts */
view2d_map_cur_using_mask(v2d, &curmasked);
/* only set matrix with 'cur' coordinates on relevant axes */
@@ -1202,7 +1216,9 @@ static void step_to_grid(float *step, int *power, int unit)
/* for frames, we want 1.0 frame intervals only */
if (unit == V2D_UNIT_FRAMES) {
rem = 1.0f;
- *step = 2.0f; /* use 2 since there are grid lines drawn in between, this way to get 1 line per frame */
+ /* use 2 since there are grid lines drawn in between,
+ * this way to get 1 line per frame */
+ *step = 2.0f;
}
/* prevents printing 1.0 2.0 3.0 etc */
@@ -1806,7 +1822,8 @@ static void scroll_printstr(Scene *scene, float x, float y, float val, int power
BLI_timecode_string_from_time_seconds(timecode_str, sizeof(timecode_str), power, val);
}
- /* get length of string, and adjust printing location to fit it into the horizontal scrollbar */
+ /* get length of string,
+ * and adjust printing location to fit it into the horizontal scrollbar */
len = strlen(timecode_str);
if (dir == 'h') {
/* seconds/timecode display has slightly longer strings... */
@@ -1935,7 +1952,8 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
break;
case V2D_UNIT_DEGREES: /* Graph Editor for rotation Drivers */
- /* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */
+ /* HACK: although we're drawing horizontal,
+ * we make this draw as 'vertical', just to get degree signs */
scroll_printstr(scene, fac, h, val, grid->powerx, V2D_UNIT_DEGREES, 'v');
break;
}
@@ -2004,7 +2022,8 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
UI_FontThemeColor(font_id, TH_TEXT);
val = grid->starty;
- /* if vertical clamping (to whole numbers) is used (i.e. in Sequencer), apply correction */
+ /* if vertical clamping (to whole numbers) is used (i.e. in Sequencer),
+ * apply correction */
if (vs->yclamp == V2D_GRID_CLAMP)
fac += 0.5f * dfac;
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 62bc7e87f0e..4a19e57ba1d 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -77,19 +77,28 @@ static bool view2d_poll(bContext *C)
/* temp customdata for operator */
typedef struct v2dViewPanData {
- bScreen *sc; /* screen where view pan was initiated */
- ScrArea *sa; /* area where view pan was initiated */
- ARegion *ar; /* region where view pan was initiated */
- View2D *v2d; /* view2d we're operating in */
+ /** screen where view pan was initiated */
+ bScreen *sc;
+ /** area where view pan was initiated */
+ ScrArea *sa;
+ /** region where view pan was initiated */
+ ARegion *ar;
+ /** view2d we're operating in */
+ View2D *v2d;
- float facx, facy; /* amount to move view relative to zoom */
+ /** amount to move view relative to zoom */
+ float facx, facy;
/* options for version 1 */
- int startx, starty; /* mouse x/y values in window when operator was initiated */
- int lastx, lasty; /* previous x/y values of mouse in window */
- int invoke_event; /* event starting pan, for modal exit */
-
- short in_scroller; /* for MMB in scrollers (old feature in past, but now not that useful) */
+ /** mouse x/y values in window when operator was initiated */
+ int startx, starty;
+ /** previous x/y values of mouse in window */
+ int lastx, lasty;
+ /** event starting pan, for modal exit */
+ int invoke_event;
+
+ /** for MMB in scrollers (old feature in past, but now not that useful) */
+ short in_scroller;
} v2dViewPanData;
/* initialize panning customdata */
@@ -256,7 +265,8 @@ static int view_pan_invoke(bContext *C, wmOperator *op, const wmEvent *event)
return OPERATOR_RUNNING_MODAL;
}
-/* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */
+/* handle user input - calculations of mouse-movement
+ * need to be done here, not in the apply callback! */
static int view_pan_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
v2dViewPanData *vpd = op->customdata;
@@ -669,7 +679,8 @@ static void view_zoomstep_apply_ex(
v2d->cur.xmax -= dx;
if (use_mousepos && (U.uiflag & USER_ZOOM_TO_MOUSEPOS)) {
- /* get zoom fac the same way as in ui_view2d_curRect_validate_resize - better keep in sync! */
+ /* get zoom fac the same way as in
+ * ui_view2d_curRect_validate_resize - better keep in sync! */
const float zoomx = (float)(BLI_rcti_size_x(&v2d->mask) + 1) / BLI_rctf_size_x(&v2d->cur);
/* only move view to mouse if zoom fac is inside minzoom/maxzoom */
@@ -702,7 +713,8 @@ static void view_zoomstep_apply_ex(
v2d->cur.ymax -= dy;
if (use_mousepos && (U.uiflag & USER_ZOOM_TO_MOUSEPOS)) {
- /* get zoom fac the same way as in ui_view2d_curRect_validate_resize - better keep in sync! */
+ /* get zoom fac the same way as in
+ * ui_view2d_curRect_validate_resize - better keep in sync! */
const float zoomy = (float)(BLI_rcti_size_y(&v2d->mask) + 1) / BLI_rctf_size_y(&v2d->cur);
/* only move view to mouse if zoom fac is inside minzoom/maxzoom */
@@ -1042,7 +1054,8 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, const wmEvent *even
fac = 0.01f * (event->prevy - event->y);
dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f;
- /* support trackpad zoom to always zoom entirely - the v2d code uses portrait or landscape exceptions */
+ /* support trackpad zoom to always zoom entirely - the v2d code uses portrait or
+ * landscape exceptions */
if (v2d->keepzoom & V2D_KEEPASPECT) {
if (fabsf(dx) > fabsf(dy))
dy = dx;
@@ -1095,7 +1108,8 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, const wmEvent *even
return OPERATOR_RUNNING_MODAL;
}
-/* handle user input - calculations of mouse-movement need to be done here, not in the apply callback! */
+/* handle user input - calculations of mouse-movement need to be done here,
+ * not in the apply callback! */
static int view_zoomdrag_modal(bContext *C, wmOperator *op, const wmEvent *event)
{
v2dViewZoomData *vzd = op->customdata;
@@ -1141,7 +1155,8 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, const wmEvent *event
}
- /* support zoom to always zoom entirely - the v2d code uses portrait or landscape exceptions */
+ /* support zoom to always zoom entirely - the v2d code uses portrait or
+ * landscape exceptions */
if (v2d->keepzoom & V2D_KEEPASPECT) {
if (fabsf(dx) > fabsf(dy))
dy = dx;
@@ -1270,7 +1285,8 @@ static int view_borderzoom_exec(bContext *C, wmOperator *op)
*/
float zoom, center, size;
- /* TODO: is this zoom factor calculation valid? It seems to produce same results every time... */
+ /* TODO: is this zoom factor calculation valid?
+ * It seems to produce same results every time... */
if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0) {
size = BLI_rctf_size_x(&cur_new);
zoom = size / BLI_rctf_size_x(&rect);
@@ -1487,7 +1503,8 @@ void UI_view2d_smooth_view(
if (v2d->smooth_timer)
WM_event_remove_timer(wm, win, v2d->smooth_timer);
/* TIMER1 is hardcoded in keymap */
- v2d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0); /* max 30 frs/sec */
+ /* max 30 frs/sec */
+ v2d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0);
ok = true;
}
@@ -1583,20 +1600,32 @@ static void VIEW2D_OT_smoothview(wmOperatorType *ot)
/* customdata for scroller-invoke data */
typedef struct v2dScrollerMove {
- View2D *v2d; /* View2D data that this operation affects */
- ARegion *ar; /* region that the scroller is in */
+ /** View2D data that this operation affects */
+ View2D *v2d;
+ /** region that the scroller is in */
+ ARegion *ar;
+
+ /** scroller that mouse is in ('h' or 'v') */
+ char scroller;
- char scroller; /* scroller that mouse is in ('h' or 'v') */
- short zone; /* -1 is min zoomer, 0 is bar, 1 is max zoomer */ // XXX find some way to provide visual feedback of this (active color?)
+ /* XXX find some way to provide visual feedback of this (active color?) */
+ /** -1 is min zoomer, 0 is bar, 1 is max zoomer */
+ short zone;
- float fac; /* view adjustment factor, based on size of region */
- float fac_round; /* for pixel rounding (avoid visible UI jitter) */
- float delta; /* amount moved by mouse on axis of interest */
+ /** view adjustment factor, based on size of region */
+ float fac;
+ /** for pixel rounding (avoid visible UI jitter) */
+ float fac_round;
+ /** amount moved by mouse on axis of interest */
+ float delta;
- float scrollbarwidth; /* width of the scrollbar itself, used for page up/down clicks */
- int scrollbar_orig; /* initial location of scrollbar x/y, mouse relative */
+ /** width of the scrollbar itself, used for page up/down clicks */
+ float scrollbarwidth;
+ /** initial location of scrollbar x/y, mouse relative */
+ int scrollbar_orig;
- int lastx, lasty; /* previous mouse coordinates (in screen coordinates) for determining movement */
+ /** previous mouse coordinates (in screen coordinates) for determining movement */
+ int lastx, lasty;
} v2dScrollerMove;
@@ -1719,8 +1748,8 @@ static void scroller_activate_init(bContext *C, wmOperator *op, const wmEvent *e
*/
scrollers = UI_view2d_scrollers_calc(C, v2d, NULL, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
- /* use a union of 'cur' & 'tot' incase the current view is far outside 'tot'.
- * In this cases moving the scroll bars has far too little effect and the view can get stuck [#31476] */
+ /* use a union of 'cur' & 'tot' incase the current view is far outside 'tot'. In this cases
+ * moving the scroll bars has far too little effect and the view can get stuck T31476. */
tot_cur_union = v2d->tot;
BLI_rctf_union(&tot_cur_union, &v2d->cur);
@@ -1866,10 +1895,12 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *e
if (ELEM(vsm->zone, SCROLLHANDLE_BAR, SCROLLHANDLE_MAX)) {
/* if using bar (i.e. 'panning') or 'max' zoom widget */
switch (vsm->scroller) {
- case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */
+ case 'h': /* horizontal scroller - so only horizontal movement
+ * ('cur' moves opposite to mouse) */
vsm->delta = (float)(event->x - vsm->lastx);
break;
- case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */
+ case 'v': /* vertical scroller - so only vertical movement
+ * ('cur' moves opposite to mouse) */
vsm->delta = (float)(event->y - vsm->lasty);
break;
}
@@ -1877,10 +1908,12 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *e
else if (vsm->zone == SCROLLHANDLE_MIN) {
/* using 'min' zoom widget */
switch (vsm->scroller) {
- case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves with mouse) */
+ case 'h': /* horizontal scroller - so only horizontal movement
+ * ('cur' moves with mouse) */
vsm->delta = (float)(vsm->lastx - event->x);
break;
- case 'v': /* vertical scroller - so only vertical movement ('cur' moves with to mouse) */
+ case 'v': /* vertical scroller - so only vertical movement
+ * ('cur' moves with to mouse) */
vsm->delta = (float)(vsm->lasty - event->y);
break;
}
@@ -1922,7 +1955,8 @@ static int scroller_activate_modal(bContext *C, wmOperator *op, const wmEvent *e
}
-/* a click (or click drag in progress) should have occurred, so check if it happened in scrollbar */
+/* a click (or click drag in progress)
+ * should have occurred, so check if it happened in scrollbar */
static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
ARegion *ar = CTX_wm_region(C);
@@ -1931,7 +1965,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent *
/* check if mouse in scrollbars, if they're enabled */
const char in_scroller = UI_view2d_mouse_in_scrollers(ar, v2d, event->x, event->y);
- /* if in a scroller, init customdata then set modal handler which will catch mousedown to start doing useful stuff */
+ /* if in a scroller, init customdata then set modal handler which will
+ * catch mousedown to start doing useful stuff */
if (in_scroller) {
v2dScrollerMove *vsm;
@@ -1942,10 +1977,12 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent *
/* support for quick jump to location - gtk and qt do this on linux */
if (event->type == MIDDLEMOUSE) {
switch (vsm->scroller) {
- case 'h': /* horizontal scroller - so only horizontal movement ('cur' moves opposite to mouse) */
+ case 'h': /* horizontal scroller - so only horizontal movement
+ * ('cur' moves opposite to mouse) */
vsm->delta = (float)(event->x - vsm->scrollbar_orig);
break;
- case 'v': /* vertical scroller - so only vertical movement ('cur' moves opposite to mouse) */
+ case 'v': /* vertical scroller - so only vertical movement
+ * ('cur' moves opposite to mouse) */
vsm->delta = (float)(event->y - vsm->scrollbar_orig);
break;
}
@@ -2002,7 +2039,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent *
return OPERATOR_RUNNING_MODAL;
}
else {
- /* not in scroller, so nothing happened... (pass through let's something else catch event) */
+ /* not in scroller, so nothing happened...
+ * (pass through let's something else catch event) */
return OPERATOR_PASS_THROUGH;
}
}
diff --git a/source/blender/editors/lattice/editlattice_tools.c b/source/blender/editors/lattice/editlattice_tools.c
index 2f8dc37a2f6..8c57a21c375 100644
--- a/source/blender/editors/lattice/editlattice_tools.c
+++ b/source/blender/editors/lattice/editlattice_tools.c
@@ -239,7 +239,8 @@ static int lattice_flip_exec(bContext *C, wmOperator *op)
numW = lt->pntsw;
totP = numU * numV * numW;
- /* First Pass: determine midpoint - used for flipping center verts if there are odd number of points on axis */
+ /* First Pass: determine midpoint - used for flipping center verts if there
+ * are odd number of points on axis */
switch (axis) {
case LATTICE_FLIP_U:
isOdd = numU & 1;
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c
index fc9cfc85bc5..8c33db11d06 100644
--- a/source/blender/editors/mask/mask_draw.c
+++ b/source/blender/editors/mask/mask_draw.c
@@ -634,14 +634,17 @@ static float *mask_rasterize(Mask *mask, const int width, const int height)
/* sets up the opengl context.
* width, height are to match the values from ED_mask_get_size() */
-void ED_mask_draw_region(Mask *mask, ARegion *ar,
- const char draw_flag, const char draw_type, const char overlay_mode,
- const int width_i, const int height_i, /* convert directly into aspect corrected vars */
- const float aspx, const float aspy,
- const bool do_scale_applied, const bool do_draw_cb,
- float stabmat[4][4], /* optional - only used by clip */
- const bContext *C /* optional - only used when do_post_draw is set or called from clip editor */
- )
+void ED_mask_draw_region(
+ Mask *mask, ARegion *ar,
+ const char draw_flag, const char draw_type, const char overlay_mode,
+ /* convert directly into aspect corrected vars */
+ const int width_i, const int height_i,
+ const float aspx, const float aspy,
+ const bool do_scale_applied, const bool do_draw_cb,
+ /* optional - only used by clip */
+ float stabmat[4][4],
+ /* optional - only used when do_post_draw is set or called from clip editor */
+ const bContext *C)
{
struct View2D *v2d = &ar->v2d;
@@ -718,7 +721,8 @@ void ED_mask_draw_region(Mask *mask, ARegion *ar,
MEM_freeN(buffer);
}
- /* apply transformation so mask editing tools will assume drawing from the origin in normalized space */
+ /* apply transformation so mask editing tools will assume drawing from the
+ * origin in normalized space */
GPU_matrix_push();
GPU_matrix_translate_2f(x + xofs, y + yofs);
GPU_matrix_scale_2f(zoomx, zoomy);
diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c
index 20fc403762d..9adf4c802a2 100644
--- a/source/blender/editors/mask/mask_ops.c
+++ b/source/blender/editors/mask/mask_ops.c
@@ -2220,7 +2220,8 @@ static int mask_duplicate_exec(bContext *C, wmOperator *UNUSED(op))
MaskSplinePoint *new_point;
int b;
- /* BKE_mask_spline_add might allocate the points, need to free them in this case. */
+ /* BKE_mask_spline_add might allocate the points,
+ * need to free them in this case. */
if (new_spline->points) {
MEM_freeN(new_spline->points);
}
diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c
index 8e64ed93842..ef6e67b3d5c 100644
--- a/source/blender/editors/mesh/editface.c
+++ b/source/blender/editors/mesh/editface.c
@@ -548,7 +548,8 @@ void paintvert_tag_select_update(struct bContext *C, struct Object *ob)
WM_event_add_notifier(C, NC_GEOM | ND_SELECT, ob->data);
}
-/* note: if the caller passes false to flush_flags, then they will need to run paintvert_flush_flags(ob) themselves */
+/* note: if the caller passes false to flush_flags,
+ * then they will need to run paintvert_flush_flags(ob) themselves */
void paintvert_deselect_all_visible(Object *ob, int action, bool flush_flags)
{
Mesh *me;
diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c
index bcde2411899..56d3162562f 100644
--- a/source/blender/editors/mesh/editmesh_add.c
+++ b/source/blender/editors/mesh/editmesh_add.c
@@ -76,7 +76,8 @@ static Object *make_prim_init(
obedit = ED_object_add_type(C, OB_MESH, idname, loc, rot, false, local_view_bits);
/* create editmode */
- ED_object_editmode_enter(C, EM_IGNORE_LAYER); /* rare cases the active layer is messed up */
+ /* rare cases the active layer is messed up */
+ ED_object_editmode_enter(C, EM_IGNORE_LAYER);
r_creation_data->was_editmode = true;
}
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 32ad8a7c521..f2ac54bf0f4 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -90,7 +90,8 @@ typedef struct {
float initial_length[NUM_VALUE_KINDS];
float scale[NUM_VALUE_KINDS];
NumInput num_input[NUM_VALUE_KINDS];
- float shift_value[NUM_VALUE_KINDS]; /* The current value when shift is pressed. Negative when shift not active. */
+ /** The current value when shift is pressed. Negative when shift not active. */
+ float shift_value[NUM_VALUE_KINDS];
bool is_modal;
BevelObjectStore *ob_store;
@@ -189,7 +190,8 @@ static bool edbm_bevel_init(bContext *C, wmOperator *op, const bool is_modal)
if (i == OFFSET_VALUE) {
opdata->num_input[i].unit_sys = scene->unit.system;
}
- opdata->num_input[i].unit_type[0] = B_UNIT_NONE; /* Not sure this is a factor or a unit? */
+ /* Not sure this is a factor or a unit? */
+ opdata->num_input[i].unit_type[0] = B_UNIT_NONE;
}
/* avoid the cost of allocating a bm copy */
diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c
index 9eae3d3b564..4ec46ff9d2b 100644
--- a/source/blender/editors/mesh/editmesh_inset.c
+++ b/source/blender/editors/mesh/editmesh_inset.c
@@ -241,7 +241,8 @@ static bool edbm_inset_calc(wmOperator *op)
const float thickness = RNA_float_get(op->ptr, "thickness");
const float depth = RNA_float_get(op->ptr, "depth");
const bool use_outset = RNA_boolean_get(op->ptr, "use_outset");
- const bool use_select_inset = RNA_boolean_get(op->ptr, "use_select_inset"); /* not passed onto the BMO */
+ /* not passed onto the BMO */
+ const bool use_select_inset = RNA_boolean_get(op->ptr, "use_select_inset");
const bool use_individual = RNA_boolean_get(op->ptr, "use_individual");
const bool use_interpolate = RNA_boolean_get(op->ptr, "use_interpolate");
diff --git a/source/blender/editors/mesh/editmesh_intersect.c b/source/blender/editors/mesh/editmesh_intersect.c
index a625d8949a6..0d40f8589a1 100644
--- a/source/blender/editors/mesh/editmesh_intersect.c
+++ b/source/blender/editors/mesh/editmesh_intersect.c
@@ -637,8 +637,9 @@ static BMEdge *bm_face_split_edge_find(
ok = false;
}
else if (found_other_face) {
- /* double check that _all_ the faces used by v_pivot's edges are attached to this edge
- * otherwise don't attempt the split since it will give non-deterministic results */
+ /* double check that _all_ the faces used by v_pivot's edges are attached
+ * to this edge otherwise don't attempt the split since it will give
+ * non-deterministic results */
BMLoop *l_radial_iter = l_iter->radial_next;
int other_face_shared = 0;
if (l_radial_iter != l_iter) {
@@ -786,7 +787,8 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op))
dot_test = fabsf(dot_v3v3(e_dir, l->f->no));
if (dot_test < dot_best) {
- /* check we're in the correct corner (works with convex loops too) */
+ /* check we're in the correct corner
+ * (works with convex loops too) */
if (angle_signed_on_axis_v3v3v3_v3(l->prev->v->co, l->v->co, v_other->co, l->f->no) <
angle_signed_on_axis_v3v3v3_v3(l->prev->v->co, l->v->co, l->next->v->co, l->f->no))
{
@@ -881,8 +883,8 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op))
for (int j = 0; j < 2; j++) {
BMVert *v_pivot = (&e->v1)[j];
- /* checking that \a v_pivot isn't in the face
- * prevents attempting to splice the same vertex into an edge from multiple faces */
+ /* checking that \a v_pivot isn't in the face prevents attempting
+ * to splice the same vertex into an edge from multiple faces */
if (!BM_vert_in_face(v_pivot, f)) {
float v_pivot_co[3];
float v_pivot_fac;
@@ -891,7 +893,8 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op))
v_pivot_co, &v_pivot_fac);
if (e_split) {
- /* for degenerate cases this vertex may be in one of this edges radial faces */
+ /* for degenerate cases this vertex may be in one
+ * of this edges radial faces */
if (!bm_vert_in_faces_radial(v_pivot, e_split, f)) {
BMEdge *e_new;
BMVert *v_new = BM_edge_split(bm, e_split, e_split->v1, &e_new, v_pivot_fac);
diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c
index ca1251ef728..3667ec93140 100644
--- a/source/blender/editors/mesh/editmesh_knife.c
+++ b/source/blender/editors/mesh/editmesh_knife.c
@@ -2098,7 +2098,8 @@ static KnifeVert *knife_find_closest_vert(KnifeTool_OpData *kcd, float p[3], flo
knife_project_v2(kcd, kfv->cageco, kfv->sco);
- /* be strict about angle snapping, the vertex needs to be very close to the angle, or we ignore */
+ /* be strict about angle snapping, the vertex needs to be very close to the angle,
+ * or we ignore */
if (kcd->is_angle_snapping) {
if (dist_squared_to_line_segment_v2(kfv->sco, kcd->prev.mval, kcd->curr.mval) > KNIFE_FLT_EPSBIG) {
continue;
@@ -3120,7 +3121,8 @@ void EDBM_mesh_knife(bContext *C, LinkNode *polys, bool use_tag, bool cut_throug
keep_search = false;
BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
if (BM_elem_flag_test(f, BM_ELEM_TAG) == false && (F_ISECT_IS_UNKNOWN(f))) {
- /* am I connected to a tagged face via an un-tagged edge (ie, not across a cut) */
+ /* am I connected to a tagged face via an un-tagged edge
+ * (ie, not across a cut) */
BMLoop *l_first = BM_FACE_FIRST_LOOP(f);
BMLoop *l_iter = l_first;
bool found = false;
diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c
index 9c5372cafd8..352b0072c4d 100644
--- a/source/blender/editors/mesh/editmesh_loopcut.c
+++ b/source/blender/editors/mesh/editmesh_loopcut.c
@@ -221,10 +221,13 @@ static void ringsel_finish(bContext *C, wmOperator *op)
/* XXX Is this piece of code ever used now? Simple loop select is now
* in editmesh_select.c (around line 1000)... */
/* sets as active, useful for other tools */
- if (em->selectmode & SCE_SELECT_VERTEX)
- BM_select_history_store(em->bm, lcd->eed->v1); /* low priority TODO, get vertrex close to mouse */
- if (em->selectmode & SCE_SELECT_EDGE)
+ if (em->selectmode & SCE_SELECT_VERTEX) {
+ /* low priority TODO, get vertrex close to mouse */
+ BM_select_history_store(em->bm, lcd->eed->v1);
+ }
+ if (em->selectmode & SCE_SELECT_EDGE) {
BM_select_history_store(em->bm, lcd->eed);
+ }
EDBM_selectmode_flush(lcd->em);
DEG_id_tag_update(lcd->ob->data, ID_RECALC_SELECT);
@@ -698,7 +701,8 @@ void MESH_OT_loopcut(wmOperatorType *ot)
/* properties */
prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, 1000000, "Number of Cuts", "", 1, 100);
- /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */
+ /* avoid re-using last var because it can cause
+ * _very_ high poly meshes and annoy users (or worse crash) */
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
prop = RNA_def_float(ot->srna, "smoothness", 0.0f, -1e3f, 1e3f,
diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c
index 91d08953b8a..36dc6797edb 100644
--- a/source/blender/editors/mesh/editmesh_path.c
+++ b/source/blender/editors/mesh/editmesh_path.c
@@ -72,7 +72,8 @@
* \{ */
struct PathSelectParams {
- bool track_active; /* ensure the active element is the last selected item (handy for picking) */
+ /** ensure the active element is the last selected item (handy for picking) */
+ bool track_active;
bool use_topology_distance;
bool use_face_step;
bool use_fill;
diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c
index f00973768ed..ff522430e2a 100644
--- a/source/blender/editors/mesh/editmesh_rip.c
+++ b/source/blender/editors/mesh/editmesh_rip.c
@@ -313,7 +313,8 @@ static EdgeLoopPair *edbm_ripsel_looptag_helper(BMesh *bm)
uid = uid_end + bm->totedge;
lp = BLI_array_append_ret(eloop_pairs);
- BM_edge_loop_pair(e_last, &lp->l_a, &lp->l_b); /* no need to check, we know this will be true */
+ /* no need to check, we know this will be true */
+ BM_edge_loop_pair(e_last, &lp->l_a, &lp->l_b);
BLI_assert(tot == uid_end - uid_start);
@@ -795,7 +796,8 @@ static int edbm_rip_invoke__vert(bContext *C, const wmEvent *event, Object *obed
if (do_fill) {
/* Only needed when filling...
- * Also, we never want to tag best edge, that one won't change during split. See T44618. */
+ * Also, we never want to tag best edge,
+ * that one won't change during split. See T44618. */
if (larr[larr_len]->e == e_best) {
BM_elem_flag_enable(larr[larr_len]->prev->e, BM_ELEM_TAG);
}
diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c
index e522c8849c7..11de1759d42 100644
--- a/source/blender/editors/mesh/editmesh_select.c
+++ b/source/blender/editors/mesh/editmesh_select.c
@@ -204,7 +204,8 @@ void EDBM_automerge(Scene *scene, Object *obedit, bool update, const char hflag)
/** \name Back-Buffer OpenGL Selection
* \{ */
-unsigned int bm_solidoffs = 0, bm_wireoffs = 0, bm_vertoffs = 0; /* set in drawobject.c ... for colorindices */
+/* set in drawobject.c ... for colorindices */
+unsigned int bm_solidoffs = 0, bm_wireoffs = 0, bm_vertoffs = 0;
/* facilities for box select and circle select */
static BLI_bitmap *selbuf = NULL;
@@ -2245,7 +2246,8 @@ void EDBM_selectmode_set(BMEditMesh *em)
em->bm->selectmode = em->selectmode;
- edbm_strip_selections(em); /* strip BMEditSelections from em->selected that are not relevant to new mode */
+ /* strip BMEditSelections from em->selected that are not relevant to new mode */
+ edbm_strip_selections(em);
if (em->bm->totvertsel == 0 &&
em->bm->totedgesel == 0 &&
diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c
index 27ff9333492..3af4708ee9b 100644
--- a/source/blender/editors/mesh/editmesh_tools.c
+++ b/source/blender/editors/mesh/editmesh_tools.c
@@ -171,7 +171,8 @@ void MESH_OT_subdivide(wmOperatorType *ot)
/* properties */
prop = RNA_def_int(ot->srna, "number_cuts", 1, 1, 100, "Number of Cuts", "", 1, 10);
- /* avoid re-using last var because it can cause _very_ high poly meshes and annoy users (or worse crash) */
+ /* avoid re-using last var because it can cause
+ * _very_ high poly meshes and annoy users (or worse crash) */
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
RNA_def_float(ot->srna, "smoothness", 0.0f, 0.0f, 1e3f, "Smoothness", "Smoothness factor", 0.0f, 1.0f);
@@ -1173,7 +1174,8 @@ static bool edbm_connect_vert_pair(BMEditMesh *em, wmOperator *op)
len = 0;
}
else {
- EDBM_selectmode_flush(em); /* so newly created edges get the selection state from the vertex */
+ /* so newly created edges get the selection state from the vertex */
+ EDBM_selectmode_flush(em);
EDBM_update_generic(em, true, true);
}
@@ -1906,7 +1908,8 @@ static int edbm_edge_rotate_selected_exec(bContext *C, wmOperator *op)
EDBM_op_init(em, &bmop, op, "rotate_edges edges=%he use_ccw=%b", BM_ELEM_TAG, use_ccw);
/* avoids leaving old verts selected which can be a problem running multiple times,
- * since this means the edges become selected around the face which then attempt to rotate */
+ * since this means the edges become selected around the face
+ * which then attempt to rotate */
BMO_slot_buffer_hflag_disable(em->bm, bmop.slots_in, "edges", BM_EDGE, BM_ELEM_SELECT, true);
BMO_op_exec(em->bm, &bmop);
@@ -3464,8 +3467,10 @@ static float bm_edge_seg_isect(
y12 = mouse_path[i][1];
/* Perp. Distance from point to line */
- if (m2 != MAXSLOPE) dist = (y12 - m2 * x12 - b2); /* /sqrt(m2 * m2 + 1); Only looking for */
- /* change in sign. Skip extra math */
+ if (m2 != MAXSLOPE) {
+ /* /sqrt(m2 * m2 + 1); Only looking for change in sign. Skip extra math .*/
+ dist = (y12 - m2 * x12 - b2);
+ }
else dist = x22 - x12;
if (i == 0) lastdist = dist;
@@ -3592,7 +3597,8 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op)
/* TODO, investigate using index lookup for screen_vert_coords() rather then a hash table */
- /* the floating point coordinates of verts in screen space will be stored in a hash table according to the vertices pointer */
+ /* the floating point coordinates of verts in screen space will be
+ * stored in a hash table according to the vertices pointer */
screen_vert_coords = sco = MEM_mallocN(bm->totvert * sizeof(float) * 2, __func__);
BM_ITER_MESH_INDEX (bv, &iter, bm, BM_VERTS_OF_MESH, i) {
@@ -3723,8 +3729,12 @@ static Base *mesh_separate_tagged(Main *bmain, Scene *scene, ViewLayer *view_lay
CustomData_bmesh_init_pool(&bm_new->pdata, bm_mesh_allocsize_default.totface, BM_FACE);
base_new = ED_object_add_duplicate(bmain, scene, view_layer, base_old, USER_DUP_MESH);
- /* DAG_relations_tag_update(bmain); */ /* normally would call directly after but in this case delay recalc */
- assign_matarar(bmain, base_new->object, give_matarar(obedit), *give_totcolp(obedit)); /* new in 2.5 */
+
+ /* normally would call directly after but in this case delay recalc */
+ /* DAG_relations_tag_update(bmain); */
+
+ /* new in 2.5 */
+ assign_matarar(bmain, base_new->object, give_matarar(obedit), *give_totcolp(obedit));
ED_object_base_select(base_new, BA_SELECT);
@@ -5662,7 +5672,8 @@ static void sort_bmelem_flag(
float fact = reverse ? -1.0 : 1.0;
int coidx = (action == SRT_VIEW_ZAXIS) ? 2 : 0;
- mul_m4_m4m4(mat, rv3d->viewmat, ob->obmat); /* Apply the view matrix to the object matrix. */
+ /* Apply the view matrix to the object matrix. */
+ mul_m4_m4m4(mat, rv3d->viewmat, ob->obmat);
if (totelem[0]) {
pb = pblock[0] = MEM_callocN(sizeof(char) * totelem[0], "sort_bmelem vert pblock");
@@ -5801,9 +5812,11 @@ static void sort_bmelem_flag(
float srt = reverse ? (float)(MAXMAT - fa->mat_nr) : (float)fa->mat_nr;
pb[i] = false;
sb[affected[2]].org_idx = i;
- /* Multiplying with totface and adding i ensures us we keep current order for all faces of same mat. */
+ /* Multiplying with totface and adding i ensures us
+ * we keep current order for all faces of same mat. */
sb[affected[2]++].srt = srt * ((float)totelem[2]) + ((float)i);
-/* printf("e: %d; srt: %f; final: %f\n", i, srt, srt * ((float)totface) + ((float)i));*/
+ // printf("e: %d; srt: %f; final: %f\n",
+ // i, srt, srt * ((float)totface) + ((float)i));
}
else {
pb[i] = true;
@@ -7260,7 +7273,10 @@ static void point_normals_apply(bContext *C, wmOperator *op, float target[3], co
float spherized_normal[3];
sub_v3_v3v3(spherized_normal, target, lnor_ed->loc);
- normalize_v3(spherized_normal); /* otherwise, multiplication by strength is meaningless... */
+
+ /* otherwise, multiplication by strength is meaningless... */
+ normalize_v3(spherized_normal);
+
mul_v3_fl(spherized_normal, strength);
mul_v3_v3fl(lnor_ed->nloc, lnor_ed->niloc, 1.0f - strength);
add_v3_v3(lnor_ed->nloc, spherized_normal);
@@ -7346,7 +7362,8 @@ static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent *
case EDBM_CLNOR_MODAL_POINTTO_USE_MOUSE:
new_mode = EDBM_CLNOR_POINTTO_MODE_MOUSE;
- force_mousemove = true; /* We want to immediately update to mouse cursor position... */
+ /* We want to immediately update to mouse cursor position... */
+ force_mousemove = true;
ret = OPERATOR_RUNNING_MODAL;
break;
@@ -7367,7 +7384,9 @@ static int edbm_point_normals_modal(bContext *C, wmOperator *op, const wmEvent *
new_mode = EDBM_CLNOR_POINTTO_MODE_COORDINATES;
view3d_operator_needs_opengl(C);
if (EDBM_select_pick(C, event->mval, false, false, false)) {
- ED_object_calc_active_center_for_editmode(obedit, false, target); /* Point to newly selected active. */
+ /* Point to newly selected active. */
+ ED_object_calc_active_center_for_editmode(obedit, false, target);
+
add_v3_v3(target, obedit->loc);
ret = OPERATOR_RUNNING_MODAL;
}
@@ -7490,7 +7509,8 @@ static int edbm_point_normals_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* Note that 'mode' is ignored in exec case, we directly use vector stored in target_location, whatever that is. */
+ /* Note that 'mode' is ignored in exec case,
+ * we directly use vector stored in target_location, whatever that is. */
float target[3];
RNA_float_get_array(op->ptr, "target_location", target);
diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c
index 6c4e82f5b71..7e02e657321 100644
--- a/source/blender/editors/mesh/editmesh_utils.c
+++ b/source/blender/editors/mesh/editmesh_utils.c
@@ -802,7 +802,8 @@ UvElementMap *BM_uv_element_map_create(
island_number = MEM_mallocN(sizeof(*island_number) * totfaces, "uv_island_number_face");
copy_vn_i(island_number, totfaces, INVALID_ISLAND);
- /* at this point, every UvElement in vert points to a UvElement sharing the same vertex. Now we should sort uv's in islands. */
+ /* at this point, every UvElement in vert points to a UvElement sharing the same vertex.
+ * Now we should sort uv's in islands. */
for (i = 0; i < totuv; i++) {
if (element_map->buf[i].island == INVALID_ISLAND) {
element_map->buf[i].island = nislands;
@@ -821,7 +822,8 @@ UvElementMap *BM_uv_element_map_create(
initelement = element;
if (element->l->f == efa) {
- /* found the uv corresponding to our face and vertex. Now fill it to the buffer */
+ /* found the uv corresponding to our face and vertex.
+ * Now fill it to the buffer */
element->island = nislands;
map[element - element_map->buf] = islandbufsize;
islandbuf[islandbufsize].l = element->l;
@@ -1228,7 +1230,8 @@ void EDBM_mesh_hide(BMEditMesh *em, bool swap)
EDBM_selectmode_flush(em);
/* original hide flushing comment (OUTDATED):
- * hide happens on least dominant select mode, and flushes up, not down! (helps preventing errors in subsurf) */
+ * hide happens on least dominant select mode, and flushes up, not down!
+ * (helps preventing errors in subsurf) */
/* - vertex hidden, always means edge is hidden too
* - edge hidden, always means face is hidden too
* - face hidden, only set face hide
diff --git a/source/blender/editors/mesh/mesh_mirror.c b/source/blender/editors/mesh/mesh_mirror.c
index b9479a660f9..32b0b653242 100644
--- a/source/blender/editors/mesh/mesh_mirror.c
+++ b/source/blender/editors/mesh/mesh_mirror.c
@@ -317,7 +317,8 @@ void ED_mesh_mirrtopo_init(
if (em) {
BMVert **vtable = em->bm->vtable;
for (a = 1; a <= totvert; a++) {
- /* printf("I %d %ld %d\n", (a - last), MirrTopoPairs[a].hash, MirrTopoPairs[a].v_indexs); */
+ // printf("I %d %ld %d\n",
+ // (a - last), MirrTopoPairs[a].hash, MirrTopoPairs[a].v_indexs);
if ((a == totvert) || (topo_pairs[a - 1].hash != topo_pairs[a].hash)) {
const int match_count = a - last;
if (match_count == 2) {
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index adbd6e12048..05c0fddfda0 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -151,7 +151,8 @@ static void join_mesh_single(
/* check if this mesh has such a shapekey */
KeyBlock *okb = me->key ? BKE_keyblock_find_name(me->key, kb->name) : NULL;
if (okb) {
- /* copy this mesh's shapekey to the destination shapekey (need to transform first) */
+ /* copy this mesh's shapekey to the destination shapekey
+ * (need to transform first) */
float (*ocos)[3] = okb->data;
for (a = 0; a < me->totvert; a++, cos++, ocos++) {
copy_v3_v3(*cos, *ocos);
@@ -400,7 +401,8 @@ int join_mesh_exec(bContext *C, wmOperator *op)
if (me->totvert) {
- /* Add this object's materials to the base one's if they don't exist already (but only if limits not exceeded yet) */
+ /* Add this object's materials to the base one's if they don't exist already
+ * (but only if limits not exceeded yet) */
if (totcol < MAXMAT) {
for (a = 1; a <= ob_iter->totcol; a++) {
ma = give_current_material(ob_iter, a);
@@ -423,7 +425,8 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
}
- /* if this mesh has shapekeys, check if destination mesh already has matching entries too */
+ /* if this mesh has shapekeys,
+ * check if destination mesh already has matching entries too */
if (me->key && key) {
/* for remapping KeyBlock.relative */
int *index_map = MEM_mallocN(sizeof(int) * me->key->totkey, __func__);
@@ -454,7 +457,8 @@ int join_mesh_exec(bContext *C, wmOperator *op)
/* remap relative index values */
for (kb = me->key->block.first, i = 0; kb; kb = kb->next, i++) {
- if (LIKELY(kb->relative < me->key->totkey)) { /* sanity check, should always be true */
+ /* sanity check, should always be true */
+ if (LIKELY(kb->relative < me->key->totkey)) {
kb_map[i]->relative = index_map[kb->relative];
}
}
@@ -488,8 +492,10 @@ int join_mesh_exec(bContext *C, wmOperator *op)
/* inverse transform for all selected meshes in this object */
invert_m4_m4(imat, ob->obmat);
- /* Add back active mesh first. This allows to keep things similar as they were, as much as possible (i.e. data from
- * active mesh will remain first ones in new result of the merge, in same order for CD layers, etc. See also T50084.
+ /* Add back active mesh first.
+ * This allows to keep things similar as they were, as much as possible
+ * (i.e. data from active mesh will remain first ones in new result of the merge,
+ * in same order for CD layers, etc). See also T50084.
*/
join_mesh_single(
depsgraph, bmain, scene,
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 7a2b1d8ada2..918b3500a08 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1600,8 +1600,9 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
BLI_ghash_insert(dupli_gh, dob, ob_dst);
if (parent_gh) {
void **val;
- /* Due to nature of hash/comparison of this ghash, a lot of duplis may be considered as 'the same',
- * this avoids trying to insert same key several time and raise asserts in debug builds... */
+ /* Due to nature of hash/comparison of this ghash, a lot of duplis may be considered as
+ * 'the same', this avoids trying to insert same key several time and
+ * raise asserts in debug builds... */
if (!BLI_ghash_ensure_p(parent_gh, dob, &val)) {
*val = ob_dst;
}
@@ -1981,7 +1982,8 @@ static int convert_exec(bContext *C, wmOperator *op)
* datablock, but for until we've got granular update
* lets take care by selves.
*/
- /* XXX This may fail/crash, since BKE_vfont_to_curve() accesses evaluated data in some cases (bastien). */
+ /* XXX This may fail/crash, since BKE_vfont_to_curve()
+ * accesses evaluated data in some cases (bastien). */
BKE_vfont_to_curve(newob, FO_EDIT);
newob->type = OB_CURVE;
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 5a650d9dc05..b760514ef32 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -120,14 +120,22 @@ typedef struct MultiresBakerJobData {
typedef struct {
Scene *scene;
ListBase data;
- bool bake_clear; /* Clear the images before baking */
- int bake_filter; /* Bake-filter, aka margin */
- short mode; /* mode of baking (displacement, normals, AO) */
- bool use_lores_mesh; /* Use low-resolution mesh when baking displacement maps */
- int number_of_rays; /* Number of rays to be cast when doing AO baking */
- float bias; /* Bias between object and start ray point when doing AO baking */
- int threads; /* Number of threads to be used for baking */
- float user_scale; /* User scale used to scale displacement when baking derivative map. */
+ /** Clear the images before baking */
+ bool bake_clear;
+ /** Bake-filter, aka margin */
+ int bake_filter;
+ /** mode of baking (displacement, normals, AO) */
+ short mode;
+ /** Use low-resolution mesh when baking displacement maps */
+ bool use_lores_mesh;
+ /** Number of rays to be cast when doing AO baking */
+ int number_of_rays;
+ /** Bias between object and start ray point when doing AO baking */
+ float bias;
+ /** Number of threads to be used for baking */
+ int threads;
+ /** User scale used to scale displacement when baking derivative map. */
+ float user_scale;
} MultiresBakeJob;
static bool multiresbake_check(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 9239e1d1a6f..fca3cc3e9f6 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -655,7 +655,8 @@ static int bake(
const char *custom_cage, const char *filepath, const int width, const int height,
const char *identifier, ScrArea *sa, const char *uv_layer)
{
- /* We build a depsgraph for the baking, so we don't need to change the original data to adjust visibility and modifiers. */
+ /* We build a depsgraph for the baking,
+ * so we don't need to change the original data to adjust visibility and modifiers. */
Depsgraph *depsgraph = DEG_graph_new(scene, view_layer, DAG_EVAL_RENDER);
DEG_graph_build_from_view_layer(depsgraph, bmain, scene, view_layer);
diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c
index 1a9b69b38ad..c9cdb77ca65 100644
--- a/source/blender/editors/object/object_collection.c
+++ b/source/blender/editors/object/object_collection.c
@@ -562,7 +562,8 @@ void OBJECT_OT_collection_unlink(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same collection as the active */
+/* Select objects in the same collection as the active */
+static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data;
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 93ff94edc75..5416079ddf7 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -105,7 +105,8 @@ ListBase *get_active_constraints(Object *ob)
return NULL;
}
-/* Find the list that a given constraint belongs to, and/or also get the posechannel this is from (if applicable) */
+/* Find the list that a given constraint belongs to,
+ * and/or also get the posechannel this is from (if applicable) */
ListBase *get_constraint_lb(Object *ob, bConstraint *con, bPoseChannel **r_pchan)
{
if (r_pchan)
@@ -1306,7 +1307,8 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op))
if (BKE_constraint_remove_ex(lb, ob, con, true)) {
/* there's no active constraint now, so make sure this is the case */
BKE_constraints_active_set(&ob->constraints, NULL);
- ED_object_constraint_update(bmain, ob); /* needed to set the flags on posebones correctly */
+ /* needed to set the flags on posebones correctly */
+ ED_object_constraint_update(bmain, ob);
/* relatiols */
DEG_relations_tag_update(CTX_data_main(C));
@@ -1637,7 +1639,8 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
return false;
/* restricted target-type constraints -------------- */
- /* NOTE: for these, we cannot try to add a target object if no valid ones are found, since that doesn't work */
+ /* NOTE: for these, we cannot try to add a target object if no valid ones are found,
+ * since that doesn't work */
/* curve-based constraints - set the only_curve and only_ob flags */
case CONSTRAINT_TYPE_CLAMPTO:
case CONSTRAINT_TYPE_FOLLOWPATH:
diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c
index ad47e07b2e9..26ba9c31c22 100644
--- a/source/blender/editors/object/object_data_transfer.c
+++ b/source/blender/editors/object/object_data_transfer.c
@@ -71,7 +71,8 @@ static const EnumPropertyItem DT_layer_items[] = {
#if 0 /* XXX For now, would like to finish/merge work from 2014 gsoc first. */
{DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"},
#endif
-#if 0 /* XXX When SkinModifier is enabled, it seems to erase its own CD_MVERT_SKIN layer from final DM :( */
+#if 0 /* XXX When SkinModifier is enabled,
+ * it seems to erase its own CD_MVERT_SKIN layer from final DM :( */
{DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"},
#endif
{DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"},
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 09ea2188de7..b3d6b7acaa2 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -533,8 +533,10 @@ bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int f
/* flag object caches as outdated */
BKE_ptcache_ids_from_object(&pidlist, obedit, scene, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
- if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
+ /* particles don't need reset on geometry change */
+ if (pid->type != PTCACHE_TYPE_PARTICLES) {
pid->cache->flag |= PTCACHE_OUTDATED;
+ }
}
BLI_freelistN(&pidlist);
@@ -602,7 +604,9 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag
ok = 1;
ED_armature_to_edit(ob->data);
/* to ensure all goes in restposition and without striding */
- DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); /* XXX: should this be ID_RECALC_GEOMETRY? */
+
+ /* XXX: should this be ID_RECALC_GEOMETRY? */
+ DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_ARMATURE, scene);
}
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 79dffa17c7a..02ee1f9c360 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1916,7 +1916,8 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op)
/* signal to modifier to recalculate */
csmd->bind_coords_num = (unsigned int)-1;
- /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */
+ /* Force modifier to run, it will call binding routine
+ * (this has to happen outside of depsgraph evaluation). */
const int mode = csmd->modifier.mode;
csmd->modifier.mode |= eModifierMode_Realtime;
object_force_modifier_update_for_bind(depsgraph, scene, ob);
@@ -2303,7 +2304,8 @@ static int laplaciandeform_bind_exec(bContext *C, wmOperator *op)
lmd->flag |= MOD_LAPLACIANDEFORM_BIND;
}
- /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */
+ /* Force modifier to run, it will call binding routine
+ * (this has to happen outside of depsgraph evaluation). */
const int mode = lmd->modifier.mode;
lmd->modifier.mode |= eModifierMode_Realtime;
object_force_modifier_update_for_bind(depsgraph, scene, ob);
@@ -2365,7 +2367,8 @@ static int surfacedeform_bind_exec(bContext *C, wmOperator *op)
smd->flags |= MOD_SDEF_BIND;
}
- /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */
+ /* Force modifier to run, it will call binding routine
+ * (this has to happen outside of depsgraph evaluation). */
const int mode = smd->modifier.mode;
smd->modifier.mode |= eModifierMode_Realtime;
object_force_modifier_update_for_bind(depsgraph, scene, ob);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 4a306a6c4e3..05d968660f2 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -505,7 +505,8 @@ void ED_object_parent_clear(Object *ob, const int type)
switch (type) {
case CLEAR_PARENT_ALL:
{
- /* for deformers, remove corresponding modifiers to prevent a large number of modifiers building up */
+ /* for deformers, remove corresponding modifiers to prevent
+ * a large number of modifiers building up */
object_remove_parent_deform_modifiers(ob, ob->parent);
/* clear parenting relationship completely */
@@ -514,14 +515,16 @@ void ED_object_parent_clear(Object *ob, const int type)
}
case CLEAR_PARENT_KEEP_TRANSFORM:
{
- /* remove parent, and apply the parented transform result as object's local transforms */
+ /* remove parent, and apply the parented transform
+ * result as object's local transforms */
ob->parent = NULL;
BKE_object_apply_mat4(ob, ob->obmat, true, false);
break;
}
case CLEAR_PARENT_INVERSE:
{
- /* object stays parented, but the parent inverse (i.e. offset from parent to retain binding state)
+ /* object stays parented, but the parent inverse
+ * (i.e. offset from parent to retain binding state)
* is cleared. In other words: nothing to do here! */
break;
}
@@ -632,7 +635,8 @@ bool ED_object_parent_set(ReportList *reports, const bContext *C, Scene *scene,
if ((cu->flag & CU_PATH) == 0) {
cu->flag |= CU_PATH | CU_FOLLOW;
- BKE_displist_make_curveTypes(depsgraph, scene, par, false, false); /* force creation of path data */
+ /* force creation of path data */
+ BKE_displist_make_curveTypes(depsgraph, scene, par, false, false);
}
else {
cu->flag |= CU_FOLLOW;
@@ -1469,7 +1473,8 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
/* new approach, using functions from kernel */
for (a = 0; a < ob_src->totcol; a++) {
Material *ma = give_current_material(ob_src, a + 1);
- assign_material(bmain, ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); /* also works with ma==NULL */
+ /* also works with `ma == NULL` */
+ assign_material(bmain, ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF);
}
DEG_id_tag_update(&ob_dst->id, ID_RECALC_GEOMETRY);
break;
@@ -1868,7 +1873,8 @@ static void single_mat_users(Main *bmain, Scene *scene, ViewLayer *view_layer, V
for (a = 1; a <= ob->totcol; a++) {
ma = give_current_material(ob, a);
if (ma) {
- /* do not test for LIB_TAG_NEW or use newid: this functions guaranteed delivers single_users! */
+ /* do not test for LIB_TAG_NEW or use newid:
+ * this functions guaranteed delivers single_users! */
if (ma->id.us > 1) {
man = BKE_material_copy(bmain, ma);
@@ -2214,8 +2220,9 @@ static void make_override_static_tag_object(Object *obact, Object *ob)
return;
}
- /* Note: all this is very case-by-case bad handling, ultimately we'll want a real full 'automatic', generic
- * handling of all this, will probably require adding some override-aware stuff to library_query code... */
+ /* Note: all this is very case-by-case bad handling, ultimately we'll want a real full
+ * 'automatic', generic handling of all this,
+ * will probably require adding some override-aware stuff to library_query code... */
if (obact->type == OB_ARMATURE && ob->modifiers.first != NULL) {
for (ModifierData *md = ob->modifiers.first; md != NULL; md = md->next) {
@@ -2357,10 +2364,12 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
}
FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
- /* obcollection is no more duplicollection-ing, it merely parents whole collection of overriding instantiated objects. */
+ /* obcollection is no more duplicollection-ing,
+ * it merely parents whole collection of overriding instantiated objects. */
obcollection->dup_group = NULL;
- /* Also, we'd likely want to lock by default things like transformations of implicitly overridden objects? */
+ /* Also, we'd likely want to lock by default things like
+ * transformations of implicitly overridden objects? */
DEG_id_tag_update(&scene->id, 0);
@@ -2380,7 +2389,8 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
success = BKE_override_static_create_from_tag(bmain);
- /* Also, we'd likely want to lock by default things like transformations of implicitly overridden objects? */
+ /* Also, we'd likely want to lock by default things like
+ * transformations of implicitly overridden objects? */
/* Cleanup. */
BKE_main_id_clear_newpoins(bmain);
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 0b032a3111a..48b13698fa7 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -781,7 +781,8 @@ static bool select_grouped_parent(bContext *C) /* Makes parent active and de-sel
#define COLLECTION_MENU_MAX 24
-static bool select_grouped_collection(bContext *C, Object *ob) /* Select objects in the same group as the active */
+/* Select objects in the same group as the active */
+static bool select_grouped_collection(bContext *C, Object *ob)
{
bool changed = false;
Collection *collection, *ob_collections[COLLECTION_MENU_MAX];
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 1620d1f82f9..373b7a4a0aa 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -491,7 +491,8 @@ static int apply_objects_internal(
bool has_unparented_layers = false;
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
- /* Parented layers aren't supported as we can't easily re-evaluate the scene to sample parent movement */
+ /* Parented layers aren't supported as we can't easily re-evaluate
+ * the scene to sample parent movement */
if (gpl->parent == NULL) {
has_unparented_layers = true;
break;
@@ -1122,7 +1123,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
float diff_mat[4][4];
float inverse_diff_mat[4][4];
- /* recalculate all strokes (all layers are considered without evaluating lock attributtes) */
+ /* recalculate all strokes
+ * (all layers are considered without evaluating lock attributtes) */
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
/* calculate difference matrix */
ED_gpencil_parent_location(depsgraph, obact, gpd, gpl, diff_mat);
@@ -1203,7 +1205,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
BKE_object_where_is_calc(depsgraph, scene, ob_other);
if (ob_other->type == OB_ARMATURE) {
- BKE_pose_where_is(depsgraph, scene, ob_other); /* needed for bone parents */
+ /* needed for bone parents */
+ BKE_pose_where_is(depsgraph, scene, ob_other);
}
ignore_parent_tx(C, bmain, scene, ob_other);
}
@@ -1651,7 +1654,8 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const
copy_v3_v3(loc, location_world);
madd_v3_v3fl(loc, target_normal, item->xform_dist);
object_apply_location(item->ob, loc);
- copy_v3_v3(item->ob->obmat[3], loc); /* so orient behaves as expected */
+ /* so orient behaves as expected */
+ copy_v3_v3(item->ob->obmat[3], loc);
}
object_orient_to_location(item->ob, item->rot_mat, item->rot_mat[2], location_world);
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 036689509e9..31faa00db43 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -960,7 +960,9 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum)
}
void ED_vgroup_select_by_name(Object *ob, const char *name)
-{ /* note: ob->actdef==0 signals on painting to create a new one, if a bone in posemode is selected */
+{
+ /* note: ob->actdef==0 signals on painting to create a new one,
+ * if a bone in posemode is selected */
ob->actdef = defgroup_name_index(ob, name) + 1;
}
@@ -1946,20 +1948,22 @@ static int inv_cmp_mdef_vert_weights(const void *a1, const void *a2)
{
/* qsort sorts in ascending order. We want descending order to save a memcopy
* so this compare function is inverted from the standard greater than comparison qsort needs.
- * A normal compare function is called with two pointer arguments and should return an integer less than, equal to,
- * or greater than zero corresponding to whether its first argument is considered less than, equal to,
- * or greater than its second argument. This does the opposite. */
+ * A normal compare function is called with two pointer arguments and should return an integer
+ * less than, equal to, or greater than zero corresponding to whether its first argument is
+ * considered less than, equal to, or greater than its second argument.
+ * This does the opposite. */
const struct MDeformWeight *dw1 = a1, *dw2 = a2;
if (dw1->weight < dw2->weight) return 1;
else if (dw1->weight > dw2->weight) return -1;
- else if (&dw1 < &dw2) return 1; /* compare addresses so we have a stable sort algorithm */
+ else if (&dw1 < &dw2) return 1; /* compare address for stable sort algorithm */
else return -1;
}
/* Used for limiting the number of influencing bones per vertex when exporting
* skinned meshes. if all_deform_weights is True, limit all deform modifiers
- * to max_weights regardless of type, otherwise, only limit the number of influencing bones per vertex*/
+ * to max_weights regardless of type, otherwise,
+ * only limit the number of influencing bones per vertex. */
static int vgroup_limit_total_subset(
Object *ob,
const bool *vgroup_validmap,
diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c
index e8afa1ae441..cf47ecae268 100644
--- a/source/blender/editors/physics/particle_edit.c
+++ b/source/blender/editors/physics/particle_edit.c
@@ -3384,7 +3384,10 @@ static void brush_puff(PEData *data, int point_index)
/* find root coordinate and normal on emitter */
copy_v3_v3(co, key->co);
mul_m4_v3(mat, co);
- mul_v3_m4v3(kco, data->ob->imat, co); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */
+
+ /* use 'kco' as the object space version of worldspace 'co',
+ * ob->imat is set before calling */
+ mul_v3_m4v3(kco, data->ob->imat, co);
point_index = BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL);
if (point_index == -1) return;
@@ -3468,7 +3471,10 @@ static void brush_puff(PEData *data, int point_index)
float oco[3], onor[3];
copy_v3_v3(oco, key->co);
mul_m4_v3(mat, oco);
- mul_v3_m4v3(kco, data->ob->imat, oco); /* use 'kco' as the object space version of worldspace 'co', ob->imat is set before calling */
+
+ /* use 'kco' as the object space version of worldspace 'co',
+ * ob->imat is set before calling */
+ mul_v3_m4v3(kco, data->ob->imat, oco);
point_index = BLI_kdtree_find_nearest(edit->emitter_field, kco, NULL);
if (point_index != -1) {
diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c
index 4619e063dd1..935ce31f147 100644
--- a/source/blender/editors/physics/particle_object.c
+++ b/source/blender/editors/physics/particle_object.c
@@ -669,7 +669,8 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot)
ot->exec = disconnect_hair_exec;
/* flags */
- ot->flag = OPTYPE_UNDO; /* No REGISTER, redo does not work due to missing update, see T47750. */
+ /* No REGISTER, redo does not work due to missing update, see T47750. */
+ ot->flag = OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "all", 0, "All hair", "Disconnect all hair systems from the emitter mesh");
}
@@ -935,7 +936,8 @@ void PARTICLE_OT_connect_hair(wmOperatorType *ot)
ot->exec = connect_hair_exec;
/* flags */
- ot->flag = OPTYPE_UNDO; /* No REGISTER, redo does not work due to missing update, see T47750. */
+ /* No REGISTER, redo does not work due to missing update, see T47750. */
+ ot->flag = OPTYPE_UNDO;
RNA_def_boolean(ot->srna, "all", 0, "All hair", "Connect all hair systems to the emitter mesh");
}
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index 09596ed7b16..73ce1a1fa80 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -152,7 +152,8 @@ static void image_buffer_rect_update(RenderJob *rj, RenderResult *rr, ImBuf *ibu
/* if renrect argument, we only refresh scanlines */
if (renrect) {
- /* if (ymax == recty), rendering of layer is ready, we should not draw, other things happen... */
+ /* if (ymax == recty), rendering of layer is ready,
+ * we should not draw, other things happen... */
if (rr->renlay == NULL || renrect->ymax >= rr->recty)
return;
@@ -665,8 +666,9 @@ static void render_endjob(void *rjv)
{
RenderJob *rj = rjv;
- /* this render may be used again by the sequencer without the active 'Render' where the callbacks
- * would be re-assigned. assign dummy callbacks to avoid referencing freed renderjobs bug [#24508] */
+ /* this render may be used again by the sequencer without the active
+ * 'Render' where the callbacks would be re-assigned. assign dummy callbacks
+ * to avoid referencing freed renderjobs bug T24508. */
RE_InitRenderCB(rj->re);
if (rj->main != G_MAIN)
diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c
index 043265d0d71..7224de7b8bf 100644
--- a/source/blender/editors/render/render_opengl.c
+++ b/source/blender/editors/render/render_opengl.c
@@ -602,7 +602,9 @@ static bool screen_opengl_render_init(bContext *C, wmOperator *op)
oglrender->prevar = prevar;
if (is_view_context) {
- ED_view3d_context_user_region(C, &oglrender->v3d, &oglrender->ar); /* so quad view renders camera */
+ /* so quad view renders camera */
+ ED_view3d_context_user_region(C, &oglrender->v3d, &oglrender->ar);
+
oglrender->rv3d = oglrender->ar->regiondata;
/* MUST be cleared on exit */
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index f2446a01ecf..587d2d91029 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -1769,7 +1769,8 @@ void MATERIAL_OT_copy(wmOperatorType *ot)
ot->exec = copy_material_exec;
/* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL; /* no undo needed since no changes are made to the material */
+ /* no undo needed since no changes are made to the material */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL;
}
static int paste_material_exec(bContext *C, wmOperator *UNUSED(op))
@@ -1901,7 +1902,8 @@ void TEXTURE_OT_slot_copy(wmOperatorType *ot)
ot->poll = copy_mtex_poll;
/* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL; /* no undo needed since no changes are made to the mtex */
+ /* no undo needed since no changes are made to the mtex */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL;
}
static int paste_mtex_exec(bContext *C, wmOperator *UNUSED(op))
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c
index b4dc2edd7cd..b1f390263d1 100644
--- a/source/blender/editors/screen/screen_context.c
+++ b/source/blender/editors/screen/screen_context.c
@@ -251,7 +251,8 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
if (arm->flag & ARM_MIRROR_EDIT)
flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
- /* if we're filtering for editable too, use the check for that instead, as it has selection check too */
+ /* if we're filtering for editable too, use the check for that instead,
+ * as it has selection check too */
if (editable_bones) {
/* only selected + editable */
if (EBONE_EDITABLE(ebone)) {
@@ -302,7 +303,8 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult
if (arm->flag & ARM_MIRROR_EDIT)
flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
- /* if we're filtering for editable too, use the check for that instead, as it has selection check too */
+ /* if we're filtering for editable too, use the check for that instead,
+ * as it has selection check too */
if (selected_editable_bones) {
/* only selected + editable */
if (EBONE_EDITABLE(ebone)) {
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 62b4db94937..7e0116ea64d 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4183,7 +4183,8 @@ int ED_screen_animation_play(bContext *C, int sync, int mode)
WM_event_add_notifier(C, NC_SCENE | ND_FRAME, scene);
}
else {
- int refresh = SPACE_ACTION; /* these settings are currently only available from a menu in the TimeLine */
+ /* these settings are currently only available from a menu in the TimeLine */
+ int refresh = SPACE_ACTION;
if (mode == 1) /* XXX only play audio forwards!? */
BKE_sound_play_scene(scene);
@@ -4389,7 +4390,8 @@ static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *even
/* changes context! */
if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) {
- /* The header only contains the editor switcher and looks empty. So hiding in the temp window makes sense. */
+ /* The header only contains the editor switcher and looks empty.
+ * So hiding in the temp window makes sense. */
ScrArea *area = CTX_wm_area(C);
ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER);
region->flag |= RGN_FLAG_HIDDEN;
diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c
index 8e3b32941e5..893183458b1 100644
--- a/source/blender/editors/screen/screendump.c
+++ b/source/blender/editors/screen/screendump.c
@@ -279,7 +279,8 @@ static bool screenshot_poll(bContext *C)
void SCREEN_OT_screenshot(wmOperatorType *ot)
{
- ot->name = "Save Screenshot"; /* weak: opname starting with 'save' makes filewindow give save-over */
+ /* weak: opname starting with 'save' makes filewindow give save-over */
+ ot->name = "Save Screenshot";
ot->idname = "SCREEN_OT_screenshot";
ot->description = "Capture a picture of the active area or whole Blender window";
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c
index 5467312d111..44e29f66ff9 100644
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@ -316,8 +316,10 @@ static int load_tex(Brush *br, ViewContext *vc, float zoom, bool col, bool prima
pool = BKE_image_pool_new();
- if (mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
+ if (mtex->tex && mtex->tex->nodetree) {
+ /* has internal flag to detect it only does it once */
+ ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
LoadTexData data = {
.br = br, .vc = vc, .mtex = mtex, .buffer = buffer, .col = col,
@@ -801,7 +803,8 @@ static void paint_draw_alpha_overlay(
UnifiedPaintSettings *ups, Brush *brush,
ViewContext *vc, int x, int y, float zoom, ePaintMode mode)
{
- /* color means that primary brush texture is colured and secondary is used for alpha/mask control */
+ /* color means that primary brush texture is colured and
+ * secondary is used for alpha/mask control */
bool col = ELEM(mode, PAINT_MODE_TEXTURE_3D, PAINT_MODE_TEXTURE_2D, PAINT_MODE_VERTEX) ? true : false;
eOverlayControlFlags flags = BKE_paint_get_overlay_flags();
gpuPushAttrib(GPU_DEPTH_BUFFER_BIT | GPU_BLEND_BIT);
@@ -1079,8 +1082,9 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused))
float translation[2] = { x, y };
float final_radius = (BKE_brush_size_get(scene, brush) * zoomx);
- /* don't calculate rake angles while a stroke is active because the rake variables are global and
- * we may get interference with the stroke itself. For line strokes, such interference is visible */
+ /* don't calculate rake angles while a stroke is active because the rake variables are global
+ * and we may get interference with the stroke itself.
+ * For line strokes, such interference is visible */
if (!ups->stroke_active) {
paint_calculate_rake_rotation(ups, brush, translation);
}
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 04941e36455..f348273e745 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -391,11 +391,14 @@ void paint_brush_init_tex(Brush *brush)
/* init mtex nodes */
if (brush) {
MTex *mtex = &brush->mtex;
- if (mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
+ if (mtex->tex && mtex->tex->nodetree) {
+ /* has internal flag to detect it only does it once */
+ ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
mtex = &brush->mask_mtex;
- if (mtex->tex && mtex->tex->nodetree)
+ if (mtex->tex && mtex->tex->nodetree) {
ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
}
}
@@ -1105,7 +1108,8 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
/* entering paint mode also sets image to editors */
if (imapaint->mode == IMAGEPAINT_MODE_MATERIAL) {
- Material *ma = give_current_material(ob, ob->actcol); /* set the current material active paint slot on image editor */
+ /* set the current material active paint slot on image editor */
+ Material *ma = give_current_material(ob, ob->actcol);
if (ma && ma->texpaintslot)
ima = ma->texpaintslot[ma->paint_active_slot].ima;
diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c
index 90aa13ab5c1..5e01a33485e 100644
--- a/source/blender/editors/sculpt_paint/paint_image_2d.c
+++ b/source/blender/editors/sculpt_paint/paint_image_2d.c
@@ -1522,7 +1522,8 @@ void paint_2d_bucket_fill(
float image_init[2];
int minx = ibuf->x, miny = ibuf->y, maxx = 0, maxy = 0;
float pixel_color[4];
- /* We are comparing to sum of three squared values (assumed in range [0,1]), so need to multiply... */
+ /* We are comparing to sum of three squared values
+ * (assumed in range [0,1]), so need to multiply... */
float threshold_sq = br->fill_threshold * br->fill_threshold * 3;
UI_view2d_region_to_view(s->v2d, mouse_init[0], mouse_init[1], &image_init[0], &image_init[1]);
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c
index 1285616e6a2..0a972e76c9a 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -172,7 +172,8 @@ BLI_INLINE unsigned char f_to_char(const float val)
#define PROJ_SRC_VIEW_FILL 4
#define PROJ_VIEW_DATA_ID "view_data"
-#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3) /* viewmat + winmat + clipsta + clipend + is_ortho */
+/* viewmat + winmat + clipsta + clipend + is_ortho */
+#define PROJ_VIEW_DATA_SIZE (4 * 4 + 4 * 4 + 3)
#define PROJ_BUCKET_NULL 0
#define PROJ_BUCKET_INIT (1 << 0)
@@ -270,7 +271,8 @@ typedef struct ProjPaintState {
/** store options per vert, now only store if the vert is pointing away from the view. */
char *vertFlags;
- /** The size of the bucket grid, the grid span's screenMin/screenMax so you can paint outsize the screen or with 2 brushes at once. */
+ /** The size of the bucket grid, the grid span's screenMin/screenMax
+ * so you can paint outsize the screen or with 2 brushes at once. */
int buckets_x;
int buckets_y;
@@ -458,7 +460,8 @@ typedef struct ProjPixel {
* new mask value is lower then mask_accum */
unsigned short *mask_accum;
- /* horrible hack, store tile valid flag pointer here to re-validate tiles used for anchored and drag-dot strokes */
+ /* horrible hack, store tile valid flag pointer here to re-validate tiles
+ * used for anchored and drag-dot strokes */
bool *valid;
PixelPointer origColor;
@@ -687,7 +690,8 @@ static void uvco_to_wrapped_pxco(const float uv[2], int ibuf_x, int ibuf_y, floa
*y = *y * ibuf_y - 0.5f;
}
-/* Set the top-most face color that the screen space coord 'pt' touches (or return 0 if none touch) */
+/* Set the top-most face color that the screen space coord 'pt' touches
+ * (or return 0 if none touch) */
static bool project_paint_PickColor(
const ProjPaintState *ps, const float pt[2],
float *rgba_fp, unsigned char *rgba, const bool interp)
@@ -848,7 +852,8 @@ static int project_paint_occlude_ptv_clip(
/* Check if a screenspace location is occluded by any other faces
* check, pixelScreenCo must be in screenspace, its Z-Depth only needs to be used for comparison
- * and doesn't need to be correct in relation to X and Y coords (this is the case in perspective view) */
+ * and doesn't need to be correct in relation to X and Y coords
+ * (this is the case in perspective view) */
static bool project_bucket_point_occluded(
const ProjPaintState *ps, LinkNode *bucketFace,
const int orig_face, const float pixelScreenCo[4])
@@ -1438,8 +1443,10 @@ static float project_paint_uvpixel_mask(
BKE_image_release_ibuf(other_tpage, ibuf_other, NULL);
- if (!ps->do_layer_stencil_inv) /* matching the gimps layer mask black/white rules, white==full opacity */
+ if (!ps->do_layer_stencil_inv) {
+ /* matching the gimps layer mask black/white rules, white==full opacity */
mask = (1.0f - mask);
+ }
if (mask == 0.0f) {
return 0.0f;
@@ -1795,7 +1802,8 @@ static bool line_clip_rect2f(
}
- if (fabsf(l1[0] - l2[0]) < PROJ_PIXEL_TOLERANCE) { /* this is a single point (or close to)*/
+ /* this is a single point (or close to)*/
+ if (fabsf(l1[0] - l2[0]) < PROJ_PIXEL_TOLERANCE) {
if (BLI_rctf_isect_pt_v(rect, l1)) {
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
@@ -1823,7 +1831,8 @@ static bool line_clip_rect2f(
return 0;
}
- if (fabsf(l1[1] - l2[1]) < PROJ_PIXEL_TOLERANCE) { /* this is a single point (or close to)*/
+ /* this is a single point (or close to)*/
+ if (fabsf(l1[1] - l2[1]) < PROJ_PIXEL_TOLERANCE) {
if (BLI_rctf_isect_pt_v(rect, l1)) {
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
@@ -2200,7 +2209,8 @@ static void project_bucket_clip_face(
float bucket_bounds_ss[4][2];
/* detect pathological case where face the three vertices are almost collinear in screen space.
- * mostly those will be culled but when flood filling or with smooth shading it's a possibility */
+ * mostly those will be culled but when flood filling or with
+ * smooth shading it's a possibility */
if (min_fff(dist_squared_to_line_v2(v1coSS, v2coSS, v3coSS),
dist_squared_to_line_v2(v2coSS, v3coSS, v1coSS),
dist_squared_to_line_v2(v3coSS, v1coSS, v2coSS)) < PROJ_PIXEL_TOLERANCE)
@@ -2234,7 +2244,8 @@ static void project_bucket_clip_face(
*tot = 3;
return;
}
- /* handle pathological case here, no need for further intersections below since tringle area is almost zero */
+ /* handle pathological case here,
+ * no need for further intersections below since tringle area is almost zero */
if (collinear) {
int flag;
@@ -2282,7 +2293,8 @@ static void project_bucket_clip_face(
}
/* get the UV space bounding box */
- /* use IsectPT2Df_limit here so we catch points are are touching the tri edge (or a small fraction over) */
+ /* use IsectPT2Df_limit here so we catch points are are touching the tri edge
+ * (or a small fraction over) */
bucket_bounds_ss[0][0] = bucket_bounds->xmax;
bucket_bounds_ss[0][1] = bucket_bounds->ymin;
inside_face_flag |= (IsectPT2Df_limit(bucket_bounds_ss[0], v1coSS, v2coSS, v3coSS, 1 + PROJ_GEOM_TOLERANCE) ? ISECT_1 : 0);
@@ -2763,7 +2775,8 @@ static void project_paint_face_init(
#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
- /* no intersection for this entire row, after some intersection above means we can quit now */
+ /* no intersection for this entire row,
+ * after some intersection above means we can quit now */
if (has_x_isect == 0 && has_isect) {
break;
}
@@ -2898,15 +2911,17 @@ static void project_paint_face_init(
float fac;
/* We need to find the closest point along the face edge,
- * getting the screen_px_from_*** wont work because our actual location
- * is not relevant, since we are outside the face, Use VecLerpf to find
- * our location on the side of the face's UV */
+ * getting the screen_px_from_*** wont work because our
+ * actual location is not relevant, since we are outside
+ * the face, Use VecLerpf to find our location on the side
+ * of the face's UV */
#if 0
if (is_ortho) screen_px_from_ortho(ps, uv, v1co, v2co, v3co, uv1co, uv2co, uv3co, pixelScreenCo);
else screen_px_from_persp(ps, uv, v1co, v2co, v3co, uv1co, uv2co, uv3co, pixelScreenCo);
#endif
- /* Since this is a seam we need to work out where on the line this pixel is */
+ /* Since this is a seam we need to work out where on
+ * the line this pixel is */
//fac = line_point_factor_v2(uv, uv_seam_quad[0], uv_seam_quad[1]);
fac = resolve_quad_u_v2(uv, UNPACK4(seam_subsection));
interp_v3_v3v3(pixelScreenCo, edge_verts_inset_clip[0], edge_verts_inset_clip[1], fac);
@@ -2928,25 +2943,29 @@ static void project_paint_face_init(
if (ps->do_mask_normal || ps->poly_to_loop_uv_clone) {
const float uv_fac = fac1 + (fac * (fac2 - fac1));
#if 0
- /* get the UV on the line since we want to copy the pixels from there for bleeding */
+ /* get the UV on the line since we want to copy the
+ * pixels from there for bleeding */
float uv_close[2];
interp_v2_v2v2(uv_close, lt_uv_pxoffset[fidx1], lt_uv_pxoffset[fidx2], uv_fac);
barycentric_weights_v2(lt_uv_pxoffset[0], lt_uv_pxoffset[1], lt_uv_pxoffset[2], uv_close, w);
#else
- /* Cheat, we know where we are along the edge so work out the weights from that */
+ /* Cheat, we know where we are along the edge
+ * so work out the weights from that */
w[0] = w[1] = w[2] = 0.0;
w[fidx1] = 1.0f - uv_fac;
w[fidx2] = uv_fac;
#endif
}
- /* a pity we need to get the worldspace pixel location here */
+ /* a pity we need to get the worldspace
+ * pixel location here */
if (do_clip || do_3d_mapping) {
interp_v3_v3v3v3(wco, vCo[0], vCo[1], vCo[2], w);
if (do_clip && ED_view3d_clipping_test(ps->rv3d, wco, true)) {
- /* Watch out that no code below this needs to run */
+ /* Watch out that no code below
+ * this needs to run */
continue;
}
}
@@ -2965,13 +2984,15 @@ static void project_paint_face_init(
}
}
else if (has_x_isect) {
- /* assuming the face is not a bow-tie - we know we cant intersect again on the X */
+ /* assuming the face is not a bow-tie - we know
+ * we cant intersect again on the X */
break;
}
}
#if 0 /* TODO - investigate why this dosnt work sometimes! it should! */
- /* no intersection for this entire row, after some intersection above means we can quit now */
+ /* no intersection for this entire row,
+ * after some intersection above means we can quit now */
if (has_x_isect == 0 && has_isect) {
break;
}
@@ -2993,10 +3014,16 @@ static void project_paint_face_init(
* Takes floating point screenspace min/max and
* returns int min/max to be used as indices for ps->bucketRect, ps->bucketFlags
*/
-static void project_paint_bucket_bounds(const ProjPaintState *ps, const float min[2], const float max[2], int bucketMin[2], int bucketMax[2])
+static void project_paint_bucket_bounds(
+ const ProjPaintState *ps,
+ const float min[2], const float max[2],
+ int bucketMin[2], int bucketMax[2])
{
/* divide by bucketWidth & bucketHeight so the bounds are offset in bucket grid units */
- /* XXX: the offset of 0.5 is always truncated to zero and the offset of 1.5f is always truncated to 1, is this really correct?? - jwilkins */
+
+ /* XXX: the offset of 0.5 is always truncated to zero and the offset of 1.5f
+ * is always truncated to 1, is this really correct?? - jwilkins */
+
/* these offsets of 0.5 and 1.5 seem odd but they are correct */
bucketMin[0] = (int)((int)(((float)(min[0] - ps->screenMin[0]) / ps->screen_width) * ps->buckets_x) + 0.5f);
bucketMin[1] = (int)((int)(((float)(min[1] - ps->screenMin[1]) / ps->screen_height) * ps->buckets_y) + 0.5f);
@@ -3089,13 +3116,14 @@ static void project_bucket_init(
/* We want to know if a bucket and a face overlap in screen-space
*
- * Note, if this ever returns false positives its not that bad, since a face in the bounding area will have its pixels
- * calculated when it might not be needed later, (at the moment at least)
+ * Note, if this ever returns false positives its not that bad, since a face in the bounding area
+ * will have its pixels calculated when it might not be needed later, (at the moment at least)
* obviously it shouldn't have bugs though */
static bool project_bucket_face_isect(ProjPaintState *ps, int bucket_x, int bucket_y, const MLoopTri *lt)
{
- /* TODO - replace this with a tricker method that uses sideofline for all screenCoords's edges against the closest bucket corner */
+ /* TODO - replace this with a tricker method that uses sideofline for all
+ * screenCoords's edges against the closest bucket corner */
const int lt_vtri[3] = { PS_LOOPTRI_AS_VERT_INDEX_3(ps, lt) };
rctf bucket_bounds;
float p1[2], p2[2], p3[2], p4[2];
@@ -3184,7 +3212,8 @@ static void project_paint_delayed_face_init(ProjPaintState *ps, const MLoopTri *
}
}
- /* no intersection for this entire row, after some intersection above means we can quit now */
+ /* no intersection for this entire row,
+ * after some intersection above means we can quit now */
if (has_x_isect == 0 && has_isect) {
break;
}
@@ -3483,7 +3512,8 @@ static void proj_paint_state_vert_flags_init(ProjPaintState *ps)
}
if (ps->is_ortho) {
- if (dot_v3v3(ps->viewDir, no) <= ps->normal_angle__cos) { /* 1 vert of this face is towards us */
+ if (dot_v3v3(ps->viewDir, no) <= ps->normal_angle__cos) {
+ /* 1 vert of this face is towards us */
ps->vertFlags[a] |= PROJ_VERT_CULL;
}
}
@@ -3493,7 +3523,8 @@ static void proj_paint_state_vert_flags_init(ProjPaintState *ps)
if (UNLIKELY(ps->is_flip_object)) {
negate_v3(viewDirPersp);
}
- if (dot_v3v3(viewDirPersp, no) <= ps->normal_angle__cos) { /* 1 vert of this face is towards us */
+ if (dot_v3v3(viewDirPersp, no) <= ps->normal_angle__cos) {
+ /* 1 vert of this face is towards us */
ps->vertFlags[a] |= PROJ_VERT_CULL;
}
}
@@ -3828,7 +3859,8 @@ static void project_paint_prepare_all_faces(
/* don't allow using the same inage for painting and stencilling */
if (slot->ima == ps->stencil_ima) {
/* While this shouldn't be used, face-winding reads all polys.
- * It's less trouble to set all faces to valid UV's, avoiding NULL checks all over. */
+ * It's less trouble to set all faces to valid UV's,
+ * avoiding NULL checks all over. */
ps->poly_to_loop_uv[lt->poly] = mloopuv_base;
continue;
}
@@ -3903,7 +3935,8 @@ static void project_paint_prepare_all_faces(
image_index = BLI_linklist_index(image_LinkList.list, tpage);
- if (image_index == -1 && BKE_image_has_ibuf(tpage, NULL)) { /* MemArena dosnt have an append func */
+ if (image_index == -1 && BKE_image_has_ibuf(tpage, NULL)) {
+ /* MemArena dosnt have an append func */
BLI_linklist_append(&image_LinkList, tpage);
image_index = ps->image_tot;
ps->image_tot++;
@@ -4637,7 +4670,8 @@ static void *do_projectpaint_thread(void *ph_v)
softenArena = BLI_memarena_new(MEM_SIZE_OPTIMAL(1 << 16), "paint soften arena");
}
- /* printf("brush bounds %d %d %d %d\n", bucketMin[0], bucketMin[1], bucketMax[0], bucketMax[1]); */
+ /* printf("brush bounds %d %d %d %d\n",
+ * bucketMin[0], bucketMin[1], bucketMax[0], bucketMax[1]); */
while (project_bucket_iter_next(ps, &bucket_index, &bucket_bounds, pos)) {
@@ -4836,7 +4870,8 @@ static void *do_projectpaint_thread(void *ph_v)
float samplecos[3];
float texrgba[4];
- /* taking 3d copy to account for 3D mapping too. It gets concatenated during sampling */
+ /* taking 3d copy to account for 3D mapping too.
+ * It gets concatenated during sampling */
if (mtex->brush_map_mode == MTEX_MAP_MODE_3D) {
copy_v3_v3(samplecos, projPixel->worldCoSS);
}
@@ -4845,7 +4880,8 @@ static void *do_projectpaint_thread(void *ph_v)
samplecos[2] = 0.0f;
}
- /* note, for clone and smear, we only use the alpha, could be a special function */
+ /* note, for clone and smear,
+ * we only use the alpha, could be a special function */
BKE_brush_sample_tex_3d(ps->scene, brush, samplecos, texrgba, thread_index, pool);
copy_v3_v3(texrgb, texrgba);
@@ -5186,7 +5222,8 @@ static void project_state_init(bContext *C, Object *ob, ProjPaintState *ps, int
Brush *brush = ps->brush;
ps->tool = brush->imagepaint_tool;
ps->blend = brush->blend;
- /* only check for inversion for the soften tool, elsewhere, a resident brush inversion flag can cause issues */
+ /* only check for inversion for the soften tool, elsewhere,
+ * a resident brush inversion flag can cause issues */
if (brush->imagepaint_tool == PAINT_TOOL_SOFTEN) {
ps->mode = (((ps->mode == BRUSH_STROKE_INVERT) ^ ((brush->flag & BRUSH_DIR_IN) != 0)) ?
BRUSH_STROKE_INVERT : BRUSH_STROKE_NORMAL);
@@ -5670,7 +5707,8 @@ void BKE_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool
);
}
-/* Make sure that active object has a material, and assign UVs and image layers if they do not exist */
+/* Make sure that active object has a material,
+ * and assign UVs and image layers if they do not exist */
bool BKE_paint_proj_mesh_data_check(Scene *scene, Object *ob, bool *uvs, bool *mat, bool *tex, bool *stencil)
{
Mesh *me;
diff --git a/source/blender/editors/sculpt_paint/paint_mask.c b/source/blender/editors/sculpt_paint/paint_mask.c
index b8175e3d368..3f193de9031 100644
--- a/source/blender/editors/sculpt_paint/paint_mask.c
+++ b/source/blender/editors/sculpt_paint/paint_mask.c
@@ -484,7 +484,8 @@ static int paint_mask_gesture_lasso_exec(bContext *C, wmOperator *op)
data.symmpass = symmpass;
- /* gather nodes inside lasso's enclosing rectangle (should greatly help with bigger meshes) */
+ /* gather nodes inside lasso's enclosing rectangle
+ * (should greatly help with bigger meshes) */
BKE_pbvh_search_gather(pbvh, BKE_pbvh_node_planes_contain_AABB, clip_planes_final, &nodes, &totnode);
data.task_data.ob = ob;
diff --git a/source/blender/editors/sculpt_paint/paint_stroke.c b/source/blender/editors/sculpt_paint/paint_stroke.c
index 15dd0438585..4e9feb7ace4 100644
--- a/source/blender/editors/sculpt_paint/paint_stroke.c
+++ b/source/blender/editors/sculpt_paint/paint_stroke.c
@@ -494,8 +494,11 @@ static void paint_brush_stroke_add_step(bContext *C, wmOperator *op, const float
}
/* This can be removed once fixed properly in
- * BKE_brush_painter_paint(BrushPainter *painter, BrushFunc func, float *pos, double time, float pressure, void *user)
- * at zero pressure we should do nothing 1/2^12 is 0.0002 which is the sensitivity of the most sensitive pen tablet available */
+ * BKE_brush_painter_paint(
+ * BrushPainter *painter, BrushFunc func,
+ * float *pos, double time, float pressure, void *user);
+ * at zero pressure we should do nothing 1/2^12 is 0.0002
+ * which is the sensitivity of the most sensitive pen tablet available */
if (tablet && (pressure < 0.0002f) &&
((pop->s.brush->flag & BRUSH_SPACING_PRESSURE) ||
BKE_brush_use_alpha_pressure(scene, pop->s.brush) ||
@@ -980,7 +983,7 @@ static void paint_stroke_sample_average(
mul_v2_fl(average->mouse, 1.0f / stroke->num_samples);
average->pressure /= stroke->num_samples;
- /*printf("avg=(%f, %f), num=%d\n", average->mouse[0], average->mouse[1], stroke->num_samples);*/
+ // printf("avg=(%f, %f), num=%d\n", average->mouse[0], average->mouse[1], stroke->num_samples);
}
/**
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index f91c5f71b2f..2d7cd2f83a5 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -823,7 +823,8 @@ static void do_weight_paint_vertex_single(
dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags, wpi->active.lock);
if (index_mirr != -1) {
- /* only normalize if this is not a center vertex, else we get a conflict, normalizing twice */
+ /* only normalize if this is not a center vertex,
+ * else we get a conflict, normalizing twice */
if (index != index_mirr) {
do_weight_paint_normalize_all_locked_try_active(
dv_mirr, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags, wpi->mirror.lock);
@@ -2136,7 +2137,8 @@ static void wpaint_do_radial_symmetry(
}
}
-/* near duplicate of: sculpt.c's, 'do_symmetrical_brush_actions' and 'vpaint_do_symmetrical_brush_actions'. */
+/* near duplicate of: sculpt.c's,
+ * 'do_symmetrical_brush_actions' and 'vpaint_do_symmetrical_brush_actions'. */
static void wpaint_do_symmetrical_brush_actions(
bContext *C, Object *ob, VPaint *wp, Sculpt *sd, struct WPaintData *wpd, WeightPaintInfo *wpi)
{
@@ -2155,7 +2157,8 @@ static void wpaint_do_symmetrical_brush_actions(
cache->symmetry = symm;
- /* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
+ /* symm is a bit combination of XYZ - 1 is mirror
+ * X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
for (i = 1; i <= symm; i++) {
if ((symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5)))) {
cache->mirror_symmetry_pass = i;
@@ -2820,7 +2823,8 @@ static void do_vpaint_brush_blur_task_cb_ex(
col[2] = round_fl_to_uchar(sqrtf(divide_round_i(blend[2], total_hit_loops)));
col[3] = round_fl_to_uchar(sqrtf(divide_round_i(blend[3], total_hit_loops)));
- /* For each poly owning this vert, paint each loop belonging to this vert. */
+ /* For each poly owning this vert,
+ * paint each loop belonging to this vert. */
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
const int p_index = gmap->vert_to_poly[v_index].indices[j];
const int l_index = gmap->vert_to_loop[v_index].indices[j];
@@ -2917,7 +2921,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
* to neighbor direction is 0.0, meaning orthogonal. */
float stroke_dot_max = 0.0f;
- /* Get the color of the loop in the opposite direction of the brush movement */
+ /* Get the color of the loop in the opposite
+ * direction of the brush movement */
uint color_final = 0;
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
const int p_index = gmap->vert_to_poly[v_index].indices[j];
@@ -2932,7 +2937,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
if (v_other_index != v_index) {
const MVert *mv_other = &data->me->mvert[v_other_index];
- /* Get the direction from the selected vert to the neighbor. */
+ /* Get the direction from the
+ * selected vert to the neighbor. */
float other_dir[3];
sub_v3_v3v3(other_dir, mv_curr->co, mv_other->co);
project_plane_v3_v3v3(other_dir, other_dir, cache->view_normal);
@@ -2956,7 +2962,8 @@ static void do_vpaint_brush_smear_task_cb_ex(
255 * brush_fade * brush_strength *
brush_alpha_pressure * grid_alpha;
- /* For each poly owning this vert, paint each loop belonging to this vert. */
+ /* For each poly owning this vert,
+ * paint each loop belonging to this vert. */
for (int j = 0; j < gmap->vert_to_poly[v_index].count; j++) {
const int p_index = gmap->vert_to_poly[v_index].indices[j];
const int l_index = gmap->vert_to_loop[v_index].indices[j];
@@ -3097,7 +3104,8 @@ static void vpaint_do_radial_symmetry(
}
}
-/* near duplicate of: sculpt.c's, 'do_symmetrical_brush_actions' and 'wpaint_do_symmetrical_brush_actions'. */
+/* near duplicate of: sculpt.c's,
+ * 'do_symmetrical_brush_actions' and 'wpaint_do_symmetrical_brush_actions'. */
static void vpaint_do_symmetrical_brush_actions(
bContext *C, Sculpt *sd, VPaint *vp, struct VPaintData *vpd, Object *ob)
{
@@ -3116,7 +3124,8 @@ static void vpaint_do_symmetrical_brush_actions(
cache->symmetry = symm;
- /* symm is a bit combination of XYZ - 1 is mirror X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
+ /* symm is a bit combination of XYZ - 1 is mirror
+ * X; 2 is Y; 3 is XY; 4 is Z; 5 is XZ; 6 is YZ; 7 is XYZ */
for (i = 1; i <= symm; i++) {
if (symm & i && (symm != 5 || i != 3) && (symm != 6 || (i != 3 && i != 5))) {
cache->mirror_symmetry_pass = i;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index fe326ad7337..fe4472c76fe 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -214,7 +214,8 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
const int vgroup_active = vc.obact->actdef - 1;
float vgroup_weight = defvert_find_weight(&me->dvert[v_idx_best], vgroup_active);
- /* use combined weight in multipaint mode, since that's what is displayed to the user in the colors */
+ /* use combined weight in multipaint mode,
+ * since that's what is displayed to the user in the colors */
if (ts->multipaint) {
int defbase_tot_sel;
const int defbase_tot = BLI_listbase_count(&vc.obact->defbase);
@@ -229,7 +230,8 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
vgroup_weight = BKE_defvert_multipaint_collective_weight(
&me->dvert[v_idx_best], defbase_tot, defbase_sel, defbase_tot_sel, ts->auto_normalize);
- /* if autonormalize is enabled, but weights are not normalized, the value can exceed 1 */
+ /* if autonormalize is enabled, but weights are not normalized,
+ * the value can exceed 1 */
CLAMP(vgroup_weight, 0.0f, 1.0f);
}
@@ -376,7 +378,8 @@ static int weight_sample_group_exec(bContext *C, wmOperator *op)
return OPERATOR_FINISHED;
}
-/* TODO, we could make this a menu into OBJECT_OT_vertex_group_set_active rather than its own operator */
+/* TODO, we could make this a menu into OBJECT_OT_vertex_group_set_active
+ * rather than its own operator */
void PAINT_OT_weight_sample_group(wmOperatorType *ot)
{
PropertyRNA *prop = NULL;
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index 5694c760371..4081f46708d 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -108,7 +108,8 @@
*
* \{ */
-/* Check if there are any active modifiers in stack (used for flushing updates at enter/exit sculpt mode) */
+/* Check if there are any active modifiers in stack
+ * (used for flushing updates at enter/exit sculpt mode) */
static bool sculpt_has_active_modifiers(Scene *scene, Object *ob)
{
ModifierData *md;
@@ -2458,7 +2459,8 @@ static void do_snake_hook_brush_task_cb_ex(
project_plane_v3_v3v3(delta_pinch, delta_pinch, ss->cache->true_view_normal);
}
- /* important to calculate based on the grabbed location (intentionally ignore fade here). */
+ /* important to calculate based on the grabbed location
+ * (intentionally ignore fade here). */
add_v3_v3(delta_pinch, grab_delta);
sculpt_project_v3(spvc, delta_pinch, delta_pinch);
@@ -3960,7 +3962,8 @@ static void do_tiled(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSettings
const float *step = sd->paint.tile_offset;
int dim;
- /* These are integer locations, for real location: multiply with step and add orgLoc. So 0,0,0 is at orgLoc. */
+ /* These are integer locations, for real location: multiply with step and add orgLoc.
+ * So 0,0,0 is at orgLoc. */
int start[3];
int end[3];
int cur[3];
@@ -4352,7 +4355,8 @@ static void sculpt_update_cache_invariants(
if (ss->bm) {
/* Free any remaining layer displacements from nodes. If not and topology changes
- * from using another tool, then next layer toolstroke can access past disp array bounds */
+ * from using another tool, then next layer toolstroke
+ * can access past disp array bounds */
BKE_pbvh_free_layer_disp(ss->pbvh);
}
}
@@ -4805,8 +4809,10 @@ static void sculpt_brush_init_tex(const Scene *scene, Sculpt *sd, SculptSession
MTex *mtex = &brush->mtex;
/* init mtex nodes */
- if (mtex->tex && mtex->tex->nodetree)
- ntreeTexBeginExecTree(mtex->tex->nodetree); /* has internal flag to detect it only does it once */
+ if (mtex->tex && mtex->tex->nodetree) {
+ /* has internal flag to detect it only does it once */
+ ntreeTexBeginExecTree(mtex->tex->nodetree);
+ }
/* TODO: Shouldn't really have to do this at the start of every
* stroke, but sculpt would need some sort of notification when
@@ -4932,7 +4938,8 @@ static bool sculpt_stroke_test_start(bContext *C, struct wmOperator *op,
{
/* Don't start the stroke until mouse goes over the mesh.
* note: mouse will only be null when re-executing the saved stroke.
- * We have exception for 'exec' strokes since they may not set 'mouse', only 'location', see: T52195. */
+ * We have exception for 'exec' strokes since they may not set 'mouse',
+ * only 'location', see: T52195. */
if (((op->flag & OP_IS_INVOKE) == 0) ||
(mouse == NULL) || over_mesh(C, op, mouse[0], mouse[1]))
{
@@ -5177,7 +5184,7 @@ static void SCULPT_OT_brush_stroke(wmOperatorType *ot)
"Clicks on the background do not start the stroke");
}
-/**** Reset the copy of the mesh that is being sculpted on (currently just for the layer brush) ****/
+/* Reset the copy of the mesh that is being sculpted on (currently just for the layer brush) */
static int sculpt_set_persistent_base_exec(bContext *C, wmOperator *UNUSED(op))
{
diff --git a/source/blender/editors/sculpt_paint/sculpt_uv.c b/source/blender/editors/sculpt_paint/sculpt_uv.c
index 7fa7c7f37b5..5488d1fd2e9 100644
--- a/source/blender/editors/sculpt_paint/sculpt_uv.c
+++ b/source/blender/editors/sculpt_paint/sculpt_uv.c
@@ -86,7 +86,8 @@ typedef struct UvAdjacencyElement {
typedef struct UvEdge {
unsigned int uv1;
unsigned int uv2;
- /* general use flag (Used to check if edge is boundary here, and propagates to adjacency elements) */
+ /* general use flag
+ * (Used to check if edge is boundary here, and propagates to adjacency elements) */
char flag;
} UvEdge;
@@ -745,7 +746,8 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
edges[counter].uv1 = offset2;
edges[counter].uv2 = offset1;
}
- /* Hack! Set the value of the key to its flag. Now we can set the flag when an edge exists twice :) */
+ /* Hack! Set the value of the key to its flag.
+ * Now we can set the flag when an edge exists twice :) */
flag = BLI_ghash_lookup(edgeHash, &edges[counter]);
if (flag) {
*flag = 1;
diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c
index be93cc413fb..558cab760e0 100644
--- a/source/blender/editors/sound/sound_ops.c
+++ b/source/blender/editors/sound/sound_ops.c
@@ -815,7 +815,8 @@ static void SOUND_OT_unpack(wmOperatorType *ot)
/* properties */
RNA_def_enum(ot->srna, "method", rna_enum_unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
- RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Sound Name", "Sound data-block name to unpack"); /* XXX, weark!, will fail with library, name collisions */
+ /* XXX, weark!, will fail with library, name collisions */
+ RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Sound Name", "Sound data-block name to unpack");
}
/* ******************************************************* */
diff --git a/source/blender/editors/space_action/action_data.c b/source/blender/editors/space_action/action_data.c
index fa5a13a81b6..9e801a8a56b 100644
--- a/source/blender/editors/space_action/action_data.c
+++ b/source/blender/editors/space_action/action_data.c
@@ -867,7 +867,8 @@ static bool action_layer_prev_poll(bContext *C)
AnimData *adt = ED_actedit_animdata_from_context(C);
if (adt) {
if (adt->flag & ADT_NLA_EDIT_ON) {
- /* Tweak Mode: We need to check if there are any tracks below the active one that we can move to */
+ /* Tweak Mode: We need to check if there are any tracks below the active one
+ * that we can move to */
if (adt->nla_tracks.first) {
NlaTrack *nlt = (NlaTrack *)adt->nla_tracks.first;
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index e960c32cf0c..20e55f8355c 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -324,7 +324,8 @@ static bool actkeys_channels_get_selected_extents(bAnimContext *ac, float *min,
bAnimListElem *ale;
int filter;
- short found = 0; /* NOTE: not bool, since we want prioritise individual channels over expanders */
+ /* NOTE: not bool, since we want prioritise individual channels over expanders */
+ short found = 0;
float y;
/* get all items - we need to do it this way */
@@ -544,8 +545,9 @@ static short paste_action_keys(bAnimContext *ac,
*/
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
- if (ANIM_animdata_filter(ac, &anim_data, filter | ANIMFILTER_SEL, ac->data, ac->datatype) == 0)
+ if (ANIM_animdata_filter(ac, &anim_data, filter | ANIMFILTER_SEL, ac->data, ac->datatype) == 0) {
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
+ }
/* paste keyframes */
ok = paste_animedit_keys(ac, &anim_data, offset_mode, merge_mode, flip);
@@ -692,8 +694,12 @@ static void insert_action_keys(bAnimContext *ac, short mode)
/* filter data */
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
- if (mode == 2) filter |= ANIMFILTER_SEL;
- else if (mode == 3) filter |= ANIMFILTER_ACTGROUPED;
+ if (mode == 2) {
+ filter |= ANIMFILTER_SEL;
+ }
+ else if (mode == 3) {
+ filter |= ANIMFILTER_ACTGROUPED;
+ }
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
@@ -831,10 +837,12 @@ static void duplicate_action_keys(bAnimContext *ac)
int filter;
/* filter data */
- if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
+ if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
- else
+ }
+ else {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
+ }
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and delete selected keys */
@@ -899,10 +907,12 @@ static bool delete_action_keys(bAnimContext *ac)
bool changed_final = false;
/* filter data */
- if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
+ if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
- else
+ }
+ else {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
+ }
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* loop through filtered data and delete selected keys */
@@ -1586,10 +1596,12 @@ static void snap_action_keys(bAnimContext *ac, short mode)
KeyframeEditFunc edit_cb;
/* filter data */
- if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
+ if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT);
- else
+ }
+ else {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
+ }
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* get beztriple editing callbacks */
@@ -1709,10 +1721,12 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
}
/* filter data */
- if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
+ if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT | ANIMFILTER_NODUPLIS);
- else
+ }
+ else {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
+ }
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* mirror keyframes */
diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c
index 0c96560f6d5..18400d58b54 100644
--- a/source/blender/editors/space_action/action_select.c
+++ b/source/blender/editors/space_action/action_select.c
@@ -96,10 +96,12 @@ static void deselect_action_keys(bAnimContext *ac, short test, short sel)
KeyframeEditFunc test_cb, sel_cb;
/* determine type-based settings */
- if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
+ if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
- else
+ }
+ else {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
+ }
/* filter data */
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
@@ -1088,10 +1090,12 @@ static void actkeys_select_leftright(bAnimContext *ac, short leftright, short se
}
/* filter data */
- if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
+ if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
- else
+ }
+ else {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY*/ | ANIMFILTER_NODUPLIS);
+ }
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
/* select keys */
@@ -1288,7 +1292,8 @@ static void actkeys_mselect_single(bAnimContext *ac, bAnimListElem *ale, short s
}
}
-/* Option 2) Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */
+/* Option 2) Selects all the keyframes on either side of the current frame
+ * (depends on which side the mouse is on) */
/* (see actkeys_select_leftright) */
/* Option 3) Selects all visible keyframes in the same frame as the mouse click */
@@ -1308,10 +1313,12 @@ static void actkeys_mselect_column(bAnimContext *ac, short select_mode, float se
/* loop through all of the keys and select additional keyframes
* based on the keys found to be selected above
*/
- if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK))
+ if (ELEM(ac->datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE /*| ANIMFILTER_CURVESONLY */ | ANIMFILTER_NODUPLIS);
- else
+ }
+ else {
filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_NODUPLIS);
+ }
ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
@@ -1418,8 +1425,11 @@ static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_
/* x-range to check is +/- 7px for standard keyframe under standard dpi/y-scale (in screen/region-space),
* on either side of mouse click (size of keyframe icon)
*/
- key_hsize = ACHANNEL_HEIGHT(ac) * 0.8f; /* standard channel height (to allow for some slop) */
- key_hsize = roundf(key_hsize / 2.0f); /* half-size (for either side), but rounded up to nearest int (for easier targeting) */
+
+ /* standard channel height (to allow for some slop) */
+ key_hsize = ACHANNEL_HEIGHT(ac) * 0.8f;
+ /* half-size (for either side), but rounded up to nearest int (for easier targeting) */
+ key_hsize = roundf(key_hsize / 2.0f);
UI_view2d_region_to_view(v2d, mval[0] - (int)key_hsize, mval[1], &rectf.xmin, &rectf.ymin);
UI_view2d_region_to_view(v2d, mval[0] + (int)key_hsize, mval[1], &rectf.xmax, &rectf.ymax);
@@ -1492,7 +1502,8 @@ static void mouse_action_keys(bAnimContext *ac, const int mval[2], short select_
mask_to_keylist(ads, masklay, &anim_keys);
}
- /* start from keyframe at root of BST, traversing until we find one within the range that was clicked on */
+ /* start from keyframe at root of BST,
+ * traversing until we find one within the range that was clicked on */
for (ak = anim_keys.root; ak; ak = akn) {
if (IN_RANGE(ak->cfra, rectf.xmin, rectf.xmax)) {
/* set the frame to use, and apply inverse-correction for NLA-mapping
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index b41b97923e2..b89472cb625 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -552,7 +552,8 @@ static void action_listener(
saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC;
ED_area_tag_refresh(sa);
}
- /* autocolor only really needs to change when channels are added/removed, or previously hidden stuff appears
+ /* autocolor only really needs to change when channels are added/removed,
+ * or previously hidden stuff appears
* (assume for now that if just adding these works, that will be fine)
*/
else if (((wmn->data == ND_KEYFRAME) && ELEM(wmn->action, NA_ADDED, NA_REMOVED)) ||
@@ -560,7 +561,8 @@ static void action_listener(
{
ED_area_tag_refresh(sa);
}
- /* for simple edits to the curve data though (or just plain selections), a simple redraw should work
+ /* for simple edits to the curve data though (or just plain selections),
+ * a simple redraw should work
* (see T39851 for an example of how this can go wrong)
*/
else {
@@ -595,7 +597,8 @@ static void action_listener(
}
else {
switch (wmn->data) {
- case ND_OB_ACTIVE: /* selection changed, so force refresh to flush (needs flag set to do syncing) */
+ case ND_OB_ACTIVE: /* selection changed, so force refresh to flush
+ * (needs flag set to do syncing) */
case ND_OB_SELECT:
saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC;
ED_area_tag_refresh(sa);
@@ -609,7 +612,8 @@ static void action_listener(
break;
case NC_OBJECT:
switch (wmn->data) {
- case ND_BONE_SELECT: /* selection changed, so force refresh to flush (needs flag set to do syncing) */
+ case ND_BONE_SELECT: /* selection changed, so force refresh to flush
+ * (needs flag set to do syncing) */
case ND_BONE_ACTIVE:
saction->runtime.flag |= SACTION_RUNTIME_FLAG_NEED_CHAN_SYNC;
ED_area_tag_refresh(sa);
diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c
index 151959a916e..041b7277c8c 100644
--- a/source/blender/editors/space_buttons/buttons_context.c
+++ b/source/blender/editors/space_buttons/buttons_context.c
@@ -120,7 +120,8 @@ static int buttons_context_path_view_layer(ButsContextPath *path, wmWindow *win)
{
PointerRNA *ptr = &path->ptr[path->len - 1];
- /* View Layer may have already been resolved in a previous call (e.g. in buttons_context_path_linestyle). */
+ /* View Layer may have already been resolved in a previous call
+ * (e.g. in buttons_context_path_linestyle). */
if (RNA_struct_is_a(ptr->type, &RNA_ViewLayer)) {
return 1;
}
@@ -732,7 +733,8 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r
return 1;
}
else if (CTX_data_equals(member, "scene")) {
- /* Do not return one here if scene not found in path, in this case we want to get default context scene! */
+ /* Do not return one here if scene not found in path,
+ * in this case we want to get default context scene! */
return set_pointer_type(path, result, &RNA_Scene);
}
else if (CTX_data_equals(member, "world")) {
@@ -1104,7 +1106,7 @@ void buttons_context_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype buttons panel context");
strcpy(pt->idname, "BUTTONS_PT_context");
- strcpy(pt->label, N_("Context")); /* XXX C panels are not available through RNA (bpy.types)! */
+ strcpy(pt->label, N_("Context")); /* XXX C panels unavailable through RNA bpy.types! */
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
pt->poll = buttons_panel_context_poll;
pt->draw = buttons_panel_context_draw;
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index c9ba5722572..da80be2afe5 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -427,7 +427,8 @@ static void buttons_navigation_bar_region_draw(const bContext *C, ARegion *ar)
}
ED_region_panels_layout(C, ar);
- ar->v2d.scroll &= ~V2D_SCROLL_VERTICAL; /* ED_region_panels_layout adds vertical scrollbars, we don't want them. */
+ /* ED_region_panels_layout adds vertical scrollbars, we don't want them. */
+ ar->v2d.scroll &= ~V2D_SCROLL_VERTICAL;
ED_region_panels_draw(C, ar);
}
@@ -743,7 +744,8 @@ void ED_spacetype_buttons(void)
/* regions: navigation bar */
art = MEM_callocN(sizeof(ARegionType), "spacetype nav buttons region");
art->regionid = RGN_TYPE_NAV_BAR;
- art->prefsizex = AREAMINX - 3; /* XXX Works and looks best, should we update AREAMINX accordingly? */
+ art->prefsizex = AREAMINX - 3; /* XXX Works and looks best,
+ * should we update AREAMINX accordingly? */
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_FRAMES;
art->init = buttons_navigation_bar_region_init;
art->draw = buttons_navigation_bar_region_draw;
diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c
index ebe8e802a37..3f95dabf10a 100644
--- a/source/blender/editors/space_clip/clip_buttons.c
+++ b/source/blender/editors/space_clip/clip_buttons.c
@@ -184,19 +184,27 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
#define B_MARKER_FLAG 8
typedef struct {
- int compact; /* compact mode */
+ /** compact mode */
+ int compact;
MovieClip *clip;
- MovieClipUser *user; /* user of clip */
+ /** user of clip */
+ MovieClipUser *user;
MovieTrackingTrack *track;
MovieTrackingMarker *marker;
- int framenr; /* current frame number */
- float marker_pos[2]; /* position of marker in pixel coords */
- float marker_pat[2]; /* position and dimensions of marker pattern in pixel coords */
- float track_offset[2]; /* offset of "parenting" point */
- float marker_search_pos[2], marker_search[2]; /* position and dimensions of marker search in pixel coords */
- int marker_flag; /* marker's flags */
+ /** current frame number */
+ int framenr;
+ /** position of marker in pixel coords */
+ float marker_pos[2];
+ /** position and dimensions of marker pattern in pixel coords */
+ float marker_pat[2];
+ /** offset of "parenting" point */
+ float track_offset[2];
+ /** position and dimensions of marker search in pixel coords */
+ float marker_search_pos[2], marker_search[2];
+ /** marker's flags */
+ int marker_flag;
} MarkerUpdateCb;
static void to_pixel_space(float r[2], float a[2], int width, int height)
diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.c b/source/blender/editors/space_clip/clip_dopesheet_draw.c
index c05a4c1b64c..e2aa73d366d 100644
--- a/source/blender/editors/space_clip/clip_dopesheet_draw.c
+++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c
@@ -310,7 +310,8 @@ void clip_draw_dopesheet_channels(const bContext *C, ARegion *ar)
v2d->tot.ymin = (float)(-height);
}
- /* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */
+ /* need to do a view-sync here, so that the keys area doesn't jump around
+ * (it must copy this) */
UI_view2d_sync(NULL, sa, v2d, V2D_LOCK_COPY);
/* loop through channels, and set up drawing depending on their type
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 9f4983a35b2..dbfe11abf34 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -663,7 +663,8 @@ static void draw_marker_areas(SpaceClip *sc, MovieTrackingTrack *track, MovieTra
GPU_line_width(1.0f);
- /* Since we are switching solid and dashed lines in rather complex logic here, just always go with dashed shader. */
+ /* Since we are switching solid and dashed lines in rather complex logic here,
+ * just always go with dashed shader. */
immUnbindProgram();
immBindBuiltinProgram(GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR);
diff --git a/source/blender/editors/space_clip/clip_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c
index 06233d64a36..119a57bffdc 100644
--- a/source/blender/editors/space_clip/clip_graph_ops.c
+++ b/source/blender/editors/space_clip/clip_graph_ops.c
@@ -241,7 +241,8 @@ static bool mouse_select_curve(bContext *C, float co[2], bool extend)
if (userdata.track) {
if (extend) {
if (act_track == userdata.track) {
- /* currently only single curve can be selected (selected curve represents active track) */
+ /* currently only single curve can be selected
+ * (selected curve represents active track) */
act_track = NULL;
}
}
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index af7843a01a5..31a6ff5bc4b 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -581,9 +581,12 @@ static int clip_context(const bContext *C, const char *member, bContextDataResul
/* dropboxes */
static bool clip_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip))
{
- if (drag->type == WM_DRAG_PATH)
- if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
+ if (drag->type == WM_DRAG_PATH) {
+ /* rule might not work? */
+ if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) {
return true;
+ }
+ }
return false;
}
diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h
index c0ef6e95d2e..a272464e0d9 100644
--- a/source/blender/editors/space_console/console_intern.h
+++ b/source/blender/editors/space_console/console_intern.h
@@ -35,7 +35,8 @@ struct bContext;
/* console_draw.c */
void console_textview_main(struct SpaceConsole *sc, struct ARegion *ar);
-int console_textview_height(struct SpaceConsole *sc, struct ARegion *ar); /* needed to calculate the scrollbar */
+/* needed to calculate the scrollbar */
+int console_textview_height(struct SpaceConsole *sc, struct ARegion *ar);
int console_char_pick(struct SpaceConsole *sc, struct ARegion *ar, const int mval[2]);
void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy);
diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c
index 32cf5ea2055..f4bf00be22e 100644
--- a/source/blender/editors/space_console/console_ops.c
+++ b/source/blender/editors/space_console/console_ops.c
@@ -747,7 +747,8 @@ static int console_history_cycle_exec(bContext *C, wmOperator *op)
SpaceConsole *sc = CTX_wm_space_console(C);
ARegion *ar = CTX_wm_region(C);
- ConsoleLine *ci = console_history_verify(C); /* TODO - stupid, just prevents crashes when no command line */
+ /* TODO - stupid, just prevents crashes when no command line */
+ ConsoleLine *ci = console_history_verify(C);
const bool reverse = RNA_boolean_get(op->ptr, "reverse"); /* assumes down, reverse is up */
int prev_len = ci->len;
@@ -814,7 +815,8 @@ static int console_history_append_exec(bContext *C, wmOperator *op)
ARegion *ar = CTX_wm_region(C);
ScrArea *sa = CTX_wm_area(C);
ConsoleLine *ci = console_history_verify(C);
- char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, don't free */
+ /* own this text in the new line, don't free */
+ char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0);
int cursor = RNA_int_get(op->ptr, "current_character");
const bool rem_dupes = RNA_boolean_get(op->ptr, "remove_duplicates");
int prev_len = ci->len;
@@ -871,7 +873,8 @@ static int console_scrollback_append_exec(bContext *C, wmOperator *op)
ARegion *ar = CTX_wm_region(C);
ConsoleLine *ci;
- char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0); /* own this text in the new line, don't free */
+ /* own this text in the new line, don't free */
+ char *str = RNA_string_get_alloc(op->ptr, "text", NULL, 0);
int type = RNA_enum_get(op->ptr, "type");
console_history_verify(C);
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 93e10704c0c..73c670b09ac 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -310,7 +310,8 @@ static void file_draw_string(
BLI_strncpy(fname, string, FILE_MAXFILE);
UI_text_clip_middle_ex(&fs, fname, width, UI_DPI_ICON_SIZE, sizeof(fname), '\0');
- /* no text clipping needed, UI_fontstyle_draw does it but is a bit too strict (for buttons it works) */
+ /* no text clipping needed, UI_fontstyle_draw does it but is a bit too strict
+ * (for buttons it works) */
rect.xmin = sx;
rect.xmax = (int)(sx + ceil(width + 5.0f / UI_DPI_FAC));
rect.ymin = sy - height;
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index ea73026020d..07e223c4534 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -443,7 +443,8 @@ static int file_box_select_exec(bContext *C, wmOperator *op)
ret = file_select(C, &rect, select ? FILE_SEL_ADD : FILE_SEL_REMOVE, false, false);
- /* unselect '..' parent entry - it's not supposed to be selected if more than one file is selected */
+ /* unselect '..' parent entry - it's not supposed to be selected if more than
+ * one file is selected */
filelist_entry_select_index_set(sfile->files, 0, FILE_SEL_REMOVE, FILE_SEL_SELECTED, CHECK_ALL);
if (FILE_SELECT_DIR == ret) {
@@ -507,7 +508,8 @@ static int file_select_invoke(bContext *C, wmOperator *op, const wmEvent *event)
ret = file_select(C, &rect, extend ? FILE_SEL_TOGGLE : FILE_SEL_ADD, fill, do_diropen);
if (extend) {
- /* unselect '..' parent entry - it's not supposed to be selected if more than one file is selected */
+ /* unselect '..' parent entry - it's not supposed to be selected if more
+ * than one file is selected */
filelist_entry_select_index_set(sfile->files, 0, FILE_SEL_REMOVE, FILE_SEL_SELECTED, CHECK_ALL);
}
@@ -571,10 +573,11 @@ static bool file_walk_select_selection_set(
deselect = (fill || other_site == -1 ||
!filelist_entry_select_index_get(files, other_site, CHECK_ALL));
- /* don't change highlight_file here since we either want to deselect active or we want to
- * walk through a block of selected files without selecting/deselecting anything */
+ /* don't change highlight_file here since we either want to deselect active or we want
+ * to walk through a block of selected files without selecting/deselecting anything */
params->active_file = active_new;
- /* but we want to change active if we use fill (needed to get correct selection bounds) */
+ /* but we want to change active if we use fill
+ * (needed to get correct selection bounds) */
if (deselect && fill) {
active = active_new;
}
@@ -606,7 +609,8 @@ static bool file_walk_select_selection_set(
/* highlight the active walker file for extended selection for better visual feedback */
params->highlight_file = params->active_file;
- /* unselect '..' parent entry - it's not supposed to be selected if more than one file is selected */
+ /* unselect '..' parent entry - it's not supposed to be selected if more
+ * than one file is selected */
filelist_entry_select_index_set(files, 0, FILE_SEL_REMOVE, FILE_SEL_SELECTED, CHECK_ALL);
}
else {
@@ -824,7 +828,8 @@ void FILE_OT_select_all(wmOperatorType *ot)
/* ---------- BOOKMARKS ----------- */
-/* Note we could get rid of this one, but it's used by some addon so... Does not hurt keeping it around for now. */
+/* Note we could get rid of this one, but it's used by some addon so...
+ * Does not hurt keeping it around for now. */
static int bookmark_select_exec(bContext *C, wmOperator *op)
{
Main *bmain = CTX_data_main(C);
@@ -1207,7 +1212,8 @@ void file_sfile_to_operator_ex(bContext *C, wmOperator *op, SpaceFile *sfile, ch
Main *bmain = CTX_data_main(C);
PropertyRNA *prop;
- BLI_join_dirfile(filepath, FILE_MAX, sfile->params->dir, sfile->params->file); /* XXX, not real length */
+ /* XXX, not real length */
+ BLI_join_dirfile(filepath, FILE_MAX, sfile->params->dir, sfile->params->file);
if ((prop = RNA_struct_find_property(op->ptr, "relative_path"))) {
if (RNA_property_boolean_get(op->ptr, prop)) {
@@ -1243,7 +1249,8 @@ void file_sfile_to_operator_ex(bContext *C, wmOperator *op, SpaceFile *sfile, ch
num_files++;
}
}
- /* make sure the file specified in the filename button is added even if no files selected */
+ /* make sure the file specified in the filename button is added even if no
+ * files selected */
if (0 == num_files) {
RNA_property_collection_add(op->ptr, prop, &itemptr);
RNA_string_set(&itemptr, "name", sfile->params->file);
@@ -1263,7 +1270,8 @@ void file_sfile_to_operator_ex(bContext *C, wmOperator *op, SpaceFile *sfile, ch
}
}
- /* make sure the directory specified in the button is added even if no directory selected */
+ /* make sure the directory specified in the button is added even if no
+ * directory selected */
if (0 == num_dirs) {
RNA_property_collection_add(op->ptr, prop, &itemptr);
RNA_string_set(&itemptr, "name", sfile->params->dir);
@@ -1804,7 +1812,8 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
BLI_strncpy(sfile->params->renamefile, name, FILE_MAXFILE);
/* set timer to smoothly view newly generated file */
- sfile->smoothscroll_timer = WM_event_add_timer(wm, CTX_wm_window(C), TIMER1, 1.0 / 1000.0); /* max 30 frs/sec */
+ /* max 30 frs/sec */
+ sfile->smoothscroll_timer = WM_event_add_timer(wm, CTX_wm_window(C), TIMER1, 1.0 / 1000.0);
sfile->scroll_offset = 0;
/* reload dir to make sure we're seeing what's in the directory */
@@ -2001,7 +2010,8 @@ void file_filename_enter_handle(bContext *C, void *UNUSED(arg_unused), void *arg
BLI_filename_make_safe(sfile->params->file);
if (matches) {
- /* replace the pattern (or filename that the user typed in, with the first selected file of the match */
+ /* replace the pattern (or filename that the user typed in,
+ * with the first selected file of the match */
BLI_strncpy(sfile->params->file, matched_file, sizeof(sfile->params->file));
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_FILE_PARAMS, NULL);
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 218c7dcdb42..75b5218d816 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -165,7 +165,8 @@ int folderlist_clear_next(struct SpaceFile *sfile)
if (!sfile->folders_next)
return 0;
- /* if previous_folder, next_folder or refresh_folder operators are executed it doesn't clear folder_next */
+ /* if previous_folder, next_folder or refresh_folder operators are executed
+ * it doesn't clear folder_next */
folder = sfile->folders_prev->last;
if ((!folder) || (BLI_path_cmp(folder->foldername, sfile->params->dir) == 0))
return 0;
@@ -208,19 +209,24 @@ ListBase *folderlist_duplicate(ListBase *folderlist)
typedef struct FileListInternEntry {
struct FileListInternEntry *next, *prev;
- char uuid[16]; /* ASSET_UUID_LENGTH */
+ /** ASSET_UUID_LENGTH */
+ char uuid[16];
- int typeflag; /* eFileSel_File_Types */
- int blentype; /* ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
+ /** eFileSel_File_Types */
+ int typeflag;
+ /** ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
+ int blentype;
char *relpath;
- char *name; /* not strictly needed, but used during sorting, avoids to have to recompute it there... */
+ /** not strictly needed, but used during sorting, avoids to have to recompute it there... */
+ char *name;
BLI_stat_t st;
} FileListInternEntry;
typedef struct FileListIntern {
- ListBase entries; /* FileListInternEntry items. */
+ /** FileListInternEntry items. */
+ ListBase entries;
FileListInternEntry **filtered;
char curr_uuid[16]; /* Used to generate uuid during internal listing. */
@@ -235,7 +241,8 @@ typedef struct FileListEntryCache {
/* This one gathers all entries from both block and misc caches. Used for easy bulk-freing. */
ListBase cached_entries;
- /* Block cache: all entries between start and end index. used for part of the list on display. */
+ /* Block cache: all entries between start and end index.
+ * used for part of the list on display. */
FileDirEntry **block_entries;
int block_start_index, block_end_index, block_center_index, block_cursor;
@@ -910,7 +917,8 @@ static int filelist_geticon_ex(
return ICON_FILE_BLEND;
}
else if (is_main) {
- /* Do not return icon for folders if icons are not 'main' draw type (e.g. when used over previews). */
+ /* Do not return icon for folders if icons are not 'main' draw type
+ * (e.g. when used over previews). */
return ICON_FILE_FOLDER;
}
}
@@ -1002,7 +1010,8 @@ static void filelist_entry_clear(FileDirEntry *entry)
if (entry->image) {
IMB_freeImBuf(entry->image);
}
- /* For now, consider FileDirEntryRevision::poin as not owned here, so no need to do anything about it */
+ /* For now, consider FileDirEntryRevision::poin as not owned here,
+ * so no need to do anything about it */
if (!BLI_listbase_is_empty(&entry->variants)) {
FileDirEntryVariant *var;
@@ -1348,7 +1357,8 @@ void filelist_free(struct FileList *filelist)
return;
}
- filelist_clear_ex(filelist, false, false); /* No need to clear cache & selection_state, we free them anyway. */
+ /* No need to clear cache & selection_state, we free them anyway. */
+ filelist_clear_ex(filelist, false, false);
filelist_cache_free(&filelist->filelist_cache);
if (filelist->selection_state) {
@@ -1561,7 +1571,8 @@ int filelist_file_findpath(struct FileList *filelist, const char *filename)
}
/* XXX TODO Cache could probably use a ghash on paths too? Not really urgent though.
- * This is only used to find again renamed entry, annoying but looks hairy to get rid of it currently. */
+ * This is only used to find again renamed entry,
+ * annoying but looks hairy to get rid of it currently. */
for (fidx = 0; fidx < filelist->filelist.nbr_entries_filtered; fidx++) {
FileListInternEntry *entry = filelist->filelist_intern.filtered[fidx];
@@ -1602,7 +1613,8 @@ FileDirEntry *filelist_entry_find_uuid(struct FileList *filelist, const int uuid
void filelist_file_cache_slidingwindow_set(FileList *filelist, size_t window_size)
{
- /* Always keep it power of 2, in [256, 8192] range for now, cache being app. twice bigger than requested window. */
+ /* Always keep it power of 2, in [256, 8192] range for now,
+ * cache being app. twice bigger than requested window. */
size_t size = 256;
window_size *= 2;
@@ -1723,8 +1735,9 @@ bool filelist_file_cache_block(struct FileList *filelist, const int index)
else {
// printf("Partial Recaching!\n");
- /* At this point, we know we keep part of currently cached entries, so update previews if needed,
- * and remove everything from working queue - we'll add all newly needed entries at the end. */
+ /* At this point, we know we keep part of currently cached entries, so update previews
+ * if needed, and remove everything from working queue - we'll add all newly needed
+ * entries at the end. */
if (cache->flags & FLC_PREVIEWS_ACTIVE) {
filelist_cache_previews_update(filelist);
filelist_cache_previews_clear(cache);
@@ -1737,7 +1750,9 @@ bool filelist_file_cache_block(struct FileList *filelist, const int index)
int size2 = 0;
int idx1 = cache->block_cursor, idx2 = 0;
-// printf("\tcache releasing: [%d:%d] (%d, %d)\n", cache->block_start_index, cache->block_start_index + size1, cache->block_cursor, size1);
+// printf("\tcache releasing: [%d:%d] (%d, %d)\n",
+// cache->block_start_index, cache->block_start_index + size1,
+// cache->block_cursor, size1);
if (idx1 + size1 > cache_size) {
size2 = idx1 + size1 - cache_size;
@@ -1754,7 +1769,8 @@ bool filelist_file_cache_block(struct FileList *filelist, const int index)
int size2 = 0;
int idx1, idx2 = 0;
-// printf("\tcache releasing: [%d:%d] (%d)\n", cache->block_end_index - size1, cache->block_end_index, cache->block_cursor);
+// printf("\tcache releasing: [%d:%d] (%d)\n",
+// cache->block_end_index - size1, cache->block_end_index, cache->block_cursor);
idx1 = (cache->block_cursor + end_index - cache->block_start_index) % cache_size;
if (idx1 + size1 > cache_size) {
@@ -1771,7 +1787,8 @@ bool filelist_file_cache_block(struct FileList *filelist, const int index)
if (start_index < cache->block_start_index) {
/* Add (request) needed entries before already cached ones. */
- /* Note: We need some index black magic to wrap around (cycle) inside our cache_size array... */
+ /* Note: We need some index black magic to wrap around (cycle)
+ * inside our cache_size array... */
int size1 = cache->block_start_index - start_index;
int size2 = 0;
int idx1, idx2;
@@ -1802,7 +1819,8 @@ bool filelist_file_cache_block(struct FileList *filelist, const int index)
// printf("\tstart-extended...\n");
if (end_index > cache->block_end_index) {
/* Add (request) needed entries after already cached ones. */
- /* Note: We need some index black magic to wrap around (cycle) inside our cache_size array... */
+ /* Note: We need some index black magic to wrap around (cycle)
+ * inside our cache_size array... */
int size1 = end_index - cache->block_end_index;
int size2 = 0;
int idx1, idx2;
@@ -1899,11 +1917,13 @@ bool filelist_cache_previews_update(FileList *filelist)
FileListEntryPreview *preview = BLI_thread_queue_pop(cache->previews_done);
FileDirEntry *entry;
- /* Paranoid (should never happen currently since we consume this queue from a single thread), but... */
+ /* Paranoid (should never happen currently
+ * since we consume this queue from a single thread), but... */
if (!preview) {
continue;
}
- /* entry might have been removed from cache in the mean time, we do not want to cache it again here. */
+ /* entry might have been removed from cache in the mean time,
+ * we do not want to cache it again here. */
entry = filelist_file_ex(filelist, preview->index, false);
// printf("%s: %d - %s - %p\n", __func__, preview->index, preview->path, preview->img);
@@ -1921,7 +1941,8 @@ bool filelist_cache_previews_update(FileList *filelist)
}
else if (entry) {
/* We want to avoid re-processing this entry continuously!
- * Note that, since entries only live in cache, preview will be retried quite often anyway. */
+ * Note that, since entries only live in cache,
+ * preview will be retried quite often anyway. */
entry->flags |= FILE_ENTRY_INVALID_PREVIEW;
}
@@ -1964,7 +1985,8 @@ static bool file_is_blend_backup(const char *str)
return (retval);
}
-/* TODO: Maybe we should move this to BLI? On the other hand, it's using defines from spacefile area, so not sure... */
+/* TODO: Maybe we should move this to BLI?
+ * On the other hand, it's using defines from spacefile area, so not sure... */
int ED_path_extension_type(const char *path)
{
if (BLO_has_bfile_extension(path)) {
@@ -2268,7 +2290,8 @@ static int filelist_readjob_list_lib(const char *root, ListBase *entries, const
return nbr_entries;
}
- /* memory for strings is passed into filelist[i].entry->relpath and freed in filelist_entry_free. */
+ /* memory for strings is passed into filelist[i].entry->relpath
+ * and freed in filelist_entry_free. */
if (group) {
idcode = groupname_to_code(group);
names = BLO_blendhandle_get_datablock_names(libfiledata, idcode, &nnames);
@@ -2311,7 +2334,8 @@ static int filelist_readjob_list_lib(const char *root, ListBase *entries, const
}
#if 0
-/* Kept for reference here, in case we want to add back that feature later. We do not need it currently. */
+/* Kept for reference here, in case we want to add back that feature later.
+ * We do not need it currently. */
/* Code ***NOT*** updated for job stuff! */
static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
{
@@ -2385,7 +2409,8 @@ static void filelist_readjob_main_rec(Main *bmain, FileList *filelist)
}
}
- /* XXX TODO: if databrowse F4 or append/link filelist->flags & FLF_HIDE_PARENT has to be set */
+ /* XXX TODO: if databrowse F4 or append/link
+ * filelist->flags & FLF_HIDE_PARENT has to be set */
if (!(filelist->filter_data.flags & FLF_HIDE_PARENT))
filelist->filelist.nbr_entries++;
@@ -2499,10 +2524,11 @@ static void filelist_readjob_do(
BLI_stack_discard(todo_dirs);
- /* ARRRG! We have to be very careful *not to use* common BLI_path_util helpers over entry->relpath itself
- * (nor any path containing it), since it may actually be a datablock name inside .blend file,
- * which can have slashes and backslashes! See T46827.
- * Note that in the end, this means we 'cache' valid relative subdir once here, this is actually better. */
+ /* ARRRG! We have to be very careful *not to use* common BLI_path_util helpers over
+ * entry->relpath itself (nor any path containing it), since it may actually be a datablock
+ * name inside .blend file, which can have slashes and backslashes! See T46827.
+ * Note that in the end, this means we 'cache' valid relative subdir once here,
+ * this is actually better. */
BLI_strncpy(rel_subdir, subdir, sizeof(rel_subdir));
BLI_cleanup_dir(root, rel_subdir);
BLI_path_rel(rel_subdir, root);
@@ -2521,13 +2547,15 @@ static void filelist_readjob_do(
/* Generate our entry uuid. Abusing uuid as an uint32, shall be more than enough here,
* things would crash way before we overflow that counter!
* Using an atomic operation to avoid having to lock thread...
- * Note that we do not really need this here currently, since there is a single listing thread, but better
+ * Note that we do not really need this here currently,
+ * since there is a single listing thread, but better
* remain consistent about threading! */
*((uint32_t *)entry->uuid) = atomic_add_and_fetch_uint32((uint32_t *)filelist->filelist_intern.curr_uuid, 1);
/* Only thing we change in direntry here, so we need to free it first. */
MEM_freeN(entry->relpath);
- entry->relpath = BLI_strdup(dir + 2); /* + 2 to remove '//' added by BLI_path_rel to rel_subdir */
+ entry->relpath = BLI_strdup(dir + 2); /* + 2 to remove '//'
+ * added by BLI_path_rel to rel_subdir */
entry->name = BLI_strdup(fileentry_uiname(root, entry->relpath, entry->typeflag, dir));
/* Here we decide whether current filedirentry is to be listed too, or not. */
@@ -2568,7 +2596,8 @@ static void filelist_readjob_do(
MEM_freeN(subdir);
}
- /* If we were interrupted by stop, stack may not be empty and we need to free pending dir paths. */
+ /* If we were interrupted by stop, stack may not be empty and we need to free
+ * pending dir paths. */
while (!BLI_stack_is_empty(todo_dirs)) {
td_dir = BLI_stack_peek(todo_dirs);
MEM_freeN(td_dir->dir);
@@ -2601,7 +2630,8 @@ typedef struct FileListReadJob {
ThreadMutex lock;
char main_name[FILE_MAX];
struct FileList *filelist;
- struct FileList *tmp_filelist; /* XXX We may use a simpler struct here... just a linked list and root path? */
+ /** XXX We may use a simpler struct here... just a linked list and root path? */
+ struct FileList *tmp_filelist;
} FileListReadJob;
static void filelist_readjob_startjob(void *flrjv, short *stop, short *do_update, float *progress)
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index cb014f30d95..f25d3e25f0b 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -627,7 +627,8 @@ int file_select_match(struct SpaceFile *sfile, const char *pattern, char *matche
*/
for (i = 0; i < n; i++) {
file = filelist_file(sfile->files, i);
- /* Do not check whether file is a file or dir here! Causes T44243 (we do accept dirs at this stage). */
+ /* Do not check whether file is a file or dir here! Causes T44243
+ * (we do accept dirs at this stage). */
if (fnmatch(pattern, file->relpath, 0) == 0) {
filelist_entry_select_set(sfile->files, file, FILE_SEL_ADD, FILE_SEL_SELECTED, CHECK_ALL);
if (!match) {
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index 2fa9134165d..e18d4fe991e 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -512,7 +512,9 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
{
/* Get mounted volumes better method OSX 10.6 and higher, see: */
/*https://developer.apple.com/library/mac/#documentation/CoreFOundation/Reference/CFURLRef/Reference/reference.html*/
- /* we get all volumes sorted including network and do not relay on user-defined finder visibility, less confusing */
+
+ /* we get all volumes sorted including network and do not relay
+ * on user-defined finder visibility, less confusing */
CFURLRef cfURL = NULL;
CFURLEnumeratorResult result = kCFURLEnumeratorSuccess;
@@ -646,7 +648,8 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks)
* Assuming every entry ends with the share name */
const char *label = strstr(dirname, "share=");
if (label != NULL) {
- /* Move pointer so "share=" is trimmed off or use full dirname as label. */
+ /* Move pointer so "share=" is trimmed off
+ * or use full dirname as label. */
const char *label_test = label + 6;
label = *label_test ? label_test : dirname;
}
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 72ff0712a23..e3e7adb1786 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -687,7 +687,9 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
uiItemPointerR(col, &dtar_ptr, "bone_target", &tar_ptr, "bones", IFACE_("Bone"), ICON_BONE_DATA);
}
- uiLayoutSetRedAlert(col, false); /* we can clear it again now - it's only needed when creating the ID/Bone fields */
+ /* we can clear it again now - it's only needed when creating the ID/Bone fields */
+ uiLayoutSetRedAlert(col, false);
+
uiItemR(col, &dtar_ptr, "transform_space", 0, NULL, ICON_NONE);
/* Object 2 */
@@ -702,7 +704,9 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
uiItemPointerR(col, &dtar2_ptr, "bone_target", &tar_ptr, "bones", IFACE_("Bone"), ICON_BONE_DATA);
}
- uiLayoutSetRedAlert(col, false); /* we can clear it again now - it's only needed when creating the ID/Bone fields */
+ /* we can clear it again now - it's only needed when creating the ID/Bone fields */
+ uiLayoutSetRedAlert(col, false);
+
uiItemR(col, &dtar2_ptr, "transform_space", 0, NULL, ICON_NONE);
}
@@ -922,14 +926,22 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *f
subrow = uiLayoutRow(row, true);
/* 1.1.1) variable type */
- sub = uiLayoutRow(subrow, true); /* HACK: special group just for the enum, otherwise we */
- uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT); /* we get ugly layout with text included too... */
+
+ /* HACK: special group just for the enum,
+ * otherwise we get ugly layout with text included too... */
+ sub = uiLayoutRow(subrow, true);
+
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_LEFT);
uiItemR(sub, &dvar_ptr, "type", UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
/* 1.1.2) variable name */
- sub = uiLayoutRow(subrow, true); /* HACK: special group to counteract the effects of the previous */
- uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_EXPAND); /* enum, which now pushes everything too far right */
+
+ /* HACK: special group to counteract the effects of the previous enum,
+ * which now pushes everything too far right */
+ sub = uiLayoutRow(subrow, true);
+
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_EXPAND);
uiItemR(sub, &dvar_ptr, "name", 0, "", ICON_NONE);
@@ -993,7 +1005,8 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, ID *id, FCurve *f
uiItemS(layout);
uiItemS(layout);
- /* XXX: This should become redundant. But sometimes the flushing fails, so keep this around for a while longer as a "last resort" */
+ /* XXX: This should become redundant. But sometimes the flushing fails,
+ * so keep this around for a while longer as a "last resort" */
row = uiLayoutRow(layout, true);
block = uiLayoutGetBlock(row);
but = uiDefIconTextBut(block, UI_BTYPE_BUT, B_IPO_DEPCHANGE, ICON_FILE_REFRESH, IFACE_("Update Dependencies"),
@@ -1020,7 +1033,8 @@ static void graph_panel_driven_property(const bContext *C, Panel *pa)
MEM_freeN(ale);
}
-/* driver settings for active F-Curve (only for 'Drivers' mode in Graph Editor, i.e. the full "Drivers Editor") */
+/* driver settings for active F-Curve
+ * (only for 'Drivers' mode in Graph Editor, i.e. the full "Drivers Editor") */
static void graph_panel_drivers(const bContext *C, Panel *pa)
{
bAnimListElem *ale;
@@ -1198,7 +1212,9 @@ void graph_buttons_register(ARegionType *art)
pt->draw = graph_panel_drivers_popover;
pt->poll = graph_panel_drivers_popover_poll;
BLI_addtail(&art->paneltypes, pt);
- WM_paneltype_add(pt); /* This panel isn't used in this region. Add explicitly to global list (so popovers work). */
+ /* This panel isn't used in this region.
+ * Add explicitly to global list (so popovers work). */
+ WM_paneltype_add(pt);
pt = MEM_callocN(sizeof(PanelType), "spacetype graph panel modifiers");
strcpy(pt->idname, "GRAPH_PT_modifiers");
diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c
index d4f6824ccdf..0d3b55df531 100644
--- a/source/blender/editors/space_graph/graph_draw.c
+++ b/source/blender/editors/space_graph/graph_draw.c
@@ -245,13 +245,21 @@ static void draw_fcurve_selected_handle_vertices(FCurve *fcu, View2D *v2d, bool
*/
if (!sel_handle_only || BEZT_ISSEL_ANY(bezt)) {
if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) {
- if ((bezt->f1 & SELECT) == sel) /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/
+ if ((bezt->f1 & SELECT) == sel
+ /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax)*/
+ )
+ {
immVertex2fv(pos, bezt->vec[0]);
+ }
}
if (bezt->ipo == BEZT_IPO_BEZ) {
- if ((bezt->f3 & SELECT) == sel) /* && v2d->cur.xmin < bezt->vec[2][0] < v2d->cur.xmax)*/
+ if ((bezt->f3 & SELECT) == sel
+ /* && v2d->cur.xmin < bezt->vec[2][0] < v2d->cur.xmax)*/
+ )
+ {
immVertex2fv(pos, bezt->vec[2]);
+ }
}
}
}
@@ -291,7 +299,8 @@ static void draw_fcurve_vertices(ARegion *ar, FCurve *fcu, bool do_handles, bool
GPU_blend(true);
GPU_enable_program_point_size();
- /* draw the two handles first (if they're shown, the curve doesn't have just a single keyframe, and the curve is being edited) */
+ /* draw the two handles first (if they're shown, the curve doesn't
+ * have just a single keyframe, and the curve is being edited) */
if (do_handles) {
draw_fcurve_handle_vertices(fcu, v2d, sel_handle_only, pos);
}
@@ -308,13 +317,20 @@ static void draw_fcurve_vertices(ARegion *ar, FCurve *fcu, bool do_handles, bool
static bool draw_fcurve_handles_check(SpaceIpo *sipo, FCurve *fcu)
{
/* don't draw handle lines if handles are not to be shown */
- if ( (sipo->flag & SIPO_NOHANDLES) || /* handles shouldn't be shown anywhere */
- (fcu->flag & FCURVE_PROTECTED) || /* keyframes aren't editable */
+ if (
+ /* handles shouldn't be shown anywhere */
+ (sipo->flag & SIPO_NOHANDLES) ||
+ /* keyframes aren't editable */
+ (fcu->flag & FCURVE_PROTECTED) ||
#if 0 /* handles can still be selected and handle types set, better draw - campbell */
- (fcu->flag & FCURVE_INT_VALUES) || /* editing the handles here will cause weird/incorrect interpolation issues */
+ /* editing the handles here will cause weird/incorrect interpolation issues */
+ (fcu->flag & FCURVE_INT_VALUES) ||
#endif
- ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) || /* group that curve belongs to is not editable */
- (fcu->totvert <= 1) /* do not show handles if there is only 1 keyframe, otherwise they all clump together in an ugly ball */
+ /* group that curve belongs to is not editable */
+ ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ||
+ /* do not show handles if there is only 1 keyframe,
+ * otherwise they all clump together in an ugly ball */
+ (fcu->totvert <= 1)
)
{
return false;
@@ -514,7 +530,8 @@ static void draw_fcurve_curve(bAnimContext *ac, ID *id, FCurve *fcu, View2D *v2d
* loop (i.e. too close to 0), then clamp it to a determined "safe" value. The value
* chosen here is just the coarsest value which still looks reasonable...
*/
- /* grid->dx represents the number of 'frames' between gridlines, but we divide by U.v2d_min_gridsize to get pixels-steps */
+ /* grid->dx represents the number of 'frames' between gridlines,
+ * but we divide by U.v2d_min_gridsize to get pixels-steps */
/* TODO: perhaps we should have 1.0 frames as upper limit so that curves don't get too distorted? */
samplefreq = dx / (U.v2d_min_gridsize * U.pixelsize);
@@ -726,7 +743,8 @@ static void draw_fcurve_curve_bezts(bAnimContext *ac, ID *id, FCurve *fcu, View2
/* TODO: optimize this to not have to calc stuff out of view too? */
while (b--) {
if (prevbezt->ipo == BEZT_IPO_CONST) {
- /* Constant-Interpolation: draw segment between previous keyframe and next, but holding same value */
+ /* Constant-Interpolation: draw segment between previous keyframe and next,
+ * but holding same value */
v1[0] = prevbezt->vec[1][0];
v1[1] = prevbezt->vec[1][1];
immVertex2fv(pos, v1);
@@ -746,7 +764,8 @@ static void draw_fcurve_curve_bezts(bAnimContext *ac, ID *id, FCurve *fcu, View2
* - resol determines number of points to sample in between keyframes
*/
- /* resol depends on distance between points (not just horizontal) OR is a fixed high res */
+ /* resol depends on distance between points
+ * (not just horizontal) OR is a fixed high res */
/* TODO: view scale should factor into this someday too... */
if (fcu->driver) {
resol = 32;
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index 00418d6482a..6a01f4a9d49 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -279,7 +279,8 @@ void GRAPH_OT_view_all(wmOperatorType *ot)
/* api callbacks */
ot->exec = graphkeys_viewall_exec;
- ot->poll = ED_operator_graphedit_active; /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... */
+ /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... */
+ ot->poll = ED_operator_graphedit_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -298,7 +299,8 @@ void GRAPH_OT_view_selected(wmOperatorType *ot)
/* api callbacks */
ot->exec = graphkeys_view_selected_exec;
- ot->poll = ED_operator_graphedit_active; /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... */
+ /* XXX: unchecked poll to get fsamples working too, but makes modifier damage trickier... */
+ ot->poll = ED_operator_graphedit_active;
/* flags */
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
@@ -1801,9 +1803,12 @@ void GRAPH_OT_handle_type(wmOperatorType *ot)
typedef struct tEulerFilter {
struct tEulerFilter *next, *prev;
- ID *id; /* ID-block which owns the channels */
- FCurve *(fcurves[3]); /* 3 Pointers to F-Curves */
- const char *rna_path; /* Pointer to one of the RNA Path's used by one of the F-Curves */
+ /** ID-block which owns the channels */
+ ID *id;
+ /** 3 Pointers to F-Curves */
+ FCurve *(fcurves[3]);
+ /** Pointer to one of the RNA Path's used by one of the F-Curves */
+ const char *rna_path;
} tEulerFilter;
static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
@@ -1864,7 +1869,8 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
groups++;
euf->id = ale->id;
- euf->rna_path = fcu->rna_path; /* this should be safe, since we're only using it for a short time */
+ /* this should be safe, since we're only using it for a short time */
+ euf->rna_path = fcu->rna_path;
euf->fcurves[fcu->array_index] = fcu;
}
@@ -1884,7 +1890,8 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
int f;
/* sanity check: ensure that there are enough F-Curves to work on in this group */
- /* TODO: also enforce assumption that there be a full set of keyframes at each position by ensuring that totvert counts are same? */
+ /* TODO: also enforce assumption that there be a full set of keyframes
+ * at each position by ensuring that totvert counts are same? */
if (ELEM(NULL, euf->fcurves[0], euf->fcurves[1], euf->fcurves[2])) {
/* report which components are missing */
BKE_reportf(op->reports, RPT_WARNING,
@@ -1917,7 +1924,8 @@ static int graphkeys_euler_filter_exec(bContext *C, wmOperator *op)
/* > 180 degree flip? */
if ((sign * (prev->vec[1][1] - bezt->vec[1][1])) >= (float)M_PI) {
- /* 360 degrees to add/subtract frame value until difference is acceptably small that there's no more flip */
+ /* 360 degrees to add/subtract frame value until difference
+ * is acceptably small that there's no more flip */
const float fac = sign * 2.0f * (float)M_PI;
while ((sign * (prev->vec[1][1] - bezt->vec[1][1])) >= (float)M_PI) {
diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c
index 4ed6a980fcb..d09e9a713f0 100644
--- a/source/blender/editors/space_graph/graph_ops.c
+++ b/source/blender/editors/space_graph/graph_ops.c
@@ -84,7 +84,8 @@ static void graphview_cursor_apply(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C);
Scene *scene = CTX_data_scene(C);
SpaceIpo *sipo = CTX_wm_space_graph(C);
- float frame = RNA_float_get(op->ptr, "frame"); /* this isn't technically "frame", but it'll do... */
+ /* this isn't technically "frame", but it'll do... */
+ float frame = RNA_float_get(op->ptr, "frame");
/* adjust the frame or the cursor x-value */
if (sipo->mode == SIPO_MODE_DRIVERS) {
@@ -265,7 +266,8 @@ static int graphview_curves_hide_exec(bContext *C, wmOperator *op)
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
- /* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
+ /* hack: skip object channels for now, since flushing those will always flush everything,
+ * but they are always included */
/* TODO: find out why this is the case, and fix that */
if (ale->type == ANIMTYPE_OBJECT)
continue;
@@ -291,7 +293,9 @@ static int graphview_curves_hide_exec(bContext *C, wmOperator *op)
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
- /* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
+ /* hack: skip object channels for now, since flushing those
+ * will always flush everything, but they are always included */
+
/* TODO: find out why this is the case, and fix that */
if (ale->type == ANIMTYPE_OBJECT)
continue;
@@ -359,7 +363,8 @@ static int graphview_curves_reveal_exec(bContext *C, wmOperator *op)
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale = anim_data.first; ale; ale = ale->next) {
- /* hack: skip object channels for now, since flushing those will always flush everything, but they are always included */
+ /* hack: skip object channels for now, since flushing those will always flush everything,
+ * but they are always included. */
/* TODO: find out why this is the case, and fix that */
if (ale->type == ANIMTYPE_OBJECT)
continue;
diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c
index cbea292c4ec..f053c9f74fe 100644
--- a/source/blender/editors/space_graph/graph_select.c
+++ b/source/blender/editors/space_graph/graph_select.c
@@ -1421,7 +1421,8 @@ static void mouse_graph_keys(bAnimContext *ac, const int mval[2], short select_m
}
/* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */
- /* needs to be called with (sipo->flag & SIPO_SELCUVERTSONLY) otherwise the active flag won't be set [#26452] */
+ /* needs to be called with (sipo->flag & SIPO_SELCUVERTSONLY)
+ * otherwise the active flag won't be set T26452. */
if (nvi->fcu->flag & FCURVE_SELECTED) {
int filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_NODUPLIS);
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nvi->fcu, nvi->ctype);
@@ -1431,7 +1432,8 @@ static void mouse_graph_keys(bAnimContext *ac, const int mval[2], short select_m
MEM_freeN(nvi);
}
-/* Option 2) Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */
+/* Option 2) Selects all the keyframes on either side of the current frame
+ * (depends on which side the mouse is on) */
/* (see graphkeys_select_leftright) */
/* Option 3) Selects all visible keyframes in the same frame as the mouse click */
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 27e401c8948..4e37b0c7b3f 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -306,7 +306,8 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
/* cursor x-value */
float x = sipo->cursorTime;
- /* to help differentiate this from the current frame, draw slightly darker like the horizontal one */
+ /* to help differentiate this from the current frame,
+ * draw slightly darker like the horizontal one */
immUniformThemeColorShadeAlpha(TH_CFRAME, -40, -50);
GPU_blend(true);
GPU_line_width(2.0);
@@ -362,7 +363,10 @@ static void graph_channel_region_init(wmWindowManager *wm, ARegion *ar)
/* make sure we keep the hide flags */
ar->v2d.scroll |= V2D_SCROLL_RIGHT;
- ar->v2d.scroll &= ~(V2D_SCROLL_LEFT | V2D_SCROLL_TOP | V2D_SCROLL_BOTTOM); /* prevent any noise of past */
+
+ /* prevent any noise of past */
+ ar->v2d.scroll &= ~(V2D_SCROLL_LEFT | V2D_SCROLL_TOP | V2D_SCROLL_BOTTOM);
+
ar->v2d.scroll |= V2D_SCROLL_HORIZONTAL_HIDE;
ar->v2d.scroll |= V2D_SCROLL_VERTICAL_HIDE;
@@ -576,7 +580,8 @@ static void graph_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn,
/* context changes */
switch (wmn->category) {
case NC_ANIMATION:
- /* for selection changes of animation data, we can just redraw... otherwise autocolor might need to be done again */
+ /* for selection changes of animation data, we can just redraw...
+ * otherwise autocolor might need to be done again */
if (ELEM(wmn->data, ND_KEYFRAME, ND_ANIMCHAN) && (wmn->action == NA_SELECTED))
ED_area_tag_redraw(sa);
else
@@ -584,7 +589,8 @@ static void graph_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn,
break;
case NC_SCENE:
switch (wmn->data) {
- case ND_OB_ACTIVE: /* selection changed, so force refresh to flush (needs flag set to do syncing) */
+ case ND_OB_ACTIVE: /* selection changed, so force refresh to flush
+ * (needs flag set to do syncing) */
case ND_OB_SELECT:
sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC;
ED_area_tag_refresh(sa);
@@ -597,7 +603,8 @@ static void graph_listener(wmWindow *UNUSED(win), ScrArea *sa, wmNotifier *wmn,
break;
case NC_OBJECT:
switch (wmn->data) {
- case ND_BONE_SELECT: /* selection changed, so force refresh to flush (needs flag set to do syncing) */
+ case ND_BONE_SELECT: /* selection changed, so force refresh to flush
+ * (needs flag set to do syncing) */
case ND_BONE_ACTIVE:
sipo->runtime.flag |= SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC;
ED_area_tag_refresh(sa);
@@ -877,7 +884,8 @@ void ED_spacetype_ipo(void)
/* regions: channels */
art = MEM_callocN(sizeof(ARegionType), "spacetype graphedit region");
art->regionid = RGN_TYPE_CHANNELS;
- art->prefsizex = 200 + V2D_SCROLL_WIDTH; /* 200 is the 'standard', but due to scrollers, we want a bit more to fit the lock icons in */
+ /* 200 is the 'standard', but due to scrollers, we want a bit more to fit the lock icons in */
+ art->prefsizex = 200 + V2D_SCROLL_WIDTH;
art->keymapflag = ED_KEYMAP_UI | ED_KEYMAP_VIEW2D | ED_KEYMAP_FRAMES;
art->listener = graph_region_listener;
art->message_subscribe = graph_region_message_subscribe;
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c
index 26162266441..0cf304d8f7a 100644
--- a/source/blender/editors/space_image/image_buttons.c
+++ b/source/blender/editors/space_image/image_buttons.c
@@ -181,7 +181,8 @@ void image_preview_event(int event)
BIF_store_spare();
- ntreeCompositExecTree(scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings); /* 1 is do_previews */
+ /* 1 is do_previews */
+ ntreeCompositExecTree(scene->nodetree, &scene->r, 1, &scene->view_settings, &scene->display_settings);
G.scene->nodetree->timecursor = NULL;
G.scene->nodetree->test_break = NULL;
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 87d2f439ad7..9db5237fdef 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -1511,7 +1511,8 @@ void IMAGE_OT_match_movie_length(wmOperatorType *ot)
ot->exec = image_match_len_exec;
/* flags */
- ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL/* | OPTYPE_UNDO */; /* Don't think we need undo for that. */
+ /* Don't think we need undo for that. */
+ ot->flag = OPTYPE_REGISTER | OPTYPE_INTERNAL/* | OPTYPE_UNDO */;
}
/******************** replace image operator ********************/
@@ -1640,7 +1641,8 @@ static int save_image_options_init(Main *bmain, SaveImageOptions *simopts, Space
simopts->im_format = scene->r.im_format;
is_depth_set = true;
if (!BKE_image_is_multiview(ima)) {
- /* In case multiview is disabled, render settings would be invalid for render result in this area. */
+ /* In case multiview is disabled,
+ * render settings would be invalid for render result in this area. */
simopts->im_format.stereo3d_format = *ima->stereo3d_format;
simopts->im_format.views_format = ima->views_format;
}
@@ -1660,7 +1662,8 @@ static int save_image_options_init(Main *bmain, SaveImageOptions *simopts, Space
simopts->im_format.views_format = ima->views_format;
}
- //simopts->subimtype = scene->r.subimtype; /* XXX - this is lame, we need to make these available too! */
+ ///* XXX - this is lame, we need to make these available too! */
+ //simopts->subimtype = scene->r.subimtype;
BLI_strncpy(simopts->filepath, ibuf->name, sizeof(simopts->filepath));
@@ -2607,13 +2610,16 @@ static int image_invert_exec(bContext *C, wmOperator *op)
size_t i;
- if (ibuf == NULL) /* TODO: this should actually never happen, but does for render-results -> cleanup */
+ if (ibuf == NULL) {
+ /* TODO: this should actually never happen, but does for render-results -> cleanup */
return OPERATOR_CANCELLED;
+ }
if (support_undo) {
ED_image_undo_push_begin(op->type->name);
/* not strictly needed, because we only imapaint_dirty_region to invalidate all tiles
- * but better do this right in case someone copies this for a tool that uses partial redraw better */
+ * but better do this right in case someone copies this for a tool that uses partial
+ * redraw better */
ED_imapaint_clear_partial_redraw();
ED_imapaint_dirty_region(ima, ibuf, 0, 0, ibuf->x, ibuf->y, false);
}
@@ -2863,7 +2869,8 @@ void IMAGE_OT_unpack(wmOperatorType *ot)
/* properties */
RNA_def_enum(ot->srna, "method", rna_enum_unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack");
- RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Image Name", "Image data-block name to unpack"); /* XXX, weark!, will fail with library, name collisions */
+ /* XXX, weak!, will fail with library, name collisions */
+ RNA_def_string(ot->srna, "id", NULL, MAX_ID_NAME - 2, "Image Name", "Image data-block name to unpack");
}
/******************** sample image operator ********************/
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 4f2b0f0db2b..1025a924f9e 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -308,9 +308,12 @@ static void image_keymap(struct wmKeyConfig *keyconf)
/* dropboxes */
static bool image_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip))
{
- if (drag->type == WM_DRAG_PATH)
- if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */
+ if (drag->type == WM_DRAG_PATH) {
+ /* rule might not work? */
+ if (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE, ICON_FILE_BLANK)) {
return 1;
+ }
+ }
return 0;
}
@@ -403,7 +406,8 @@ static void image_listener(wmWindow *win, ScrArea *sa, wmNotifier *wmn, Scene *U
case NC_MASK:
{
// Scene *scene = wmn->window->screen->scene;
- /* ideally would check for: ED_space_image_check_show_maskedit(scene, sima) but we cant get the scene */
+ /* ideally would check for: ED_space_image_check_show_maskedit(scene, sima)
+ * but we cant get the scene */
if (sima->mode == SI_MODE_MASK) {
switch (wmn->data) {
case ND_SELECT:
diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c
index c94aaf6e861..f1a40b41d55 100644
--- a/source/blender/editors/space_info/textview.c
+++ b/source/blender/editors/space_info/textview.c
@@ -58,13 +58,16 @@ typedef struct ConsoleDrawContext {
int font_id;
int cwidth;
int lheight;
- int lofs; /* text vertical offset */
- int console_width; /* number of characters that fit into the width of the console (fixed width) */
+ /** text vertical offset */
+ int lofs;
+ /** number of characters that fit into the width of the console (fixed width) */
+ int console_width;
int winx;
int ymin, ymax;
int *xy; // [2]
int *sel; // [2]
- int *pos_pick; // bottom of view == 0, top of file == combine chars, end of line is lower then start.
+ /* bottom of view == 0, top of file == combine chars, end of line is lower then start. */
+ int *pos_pick;
const int *mval; // [2]
int draw;
} ConsoleDrawContext;
diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h
index 55f69fbf444..369dc589d74 100644
--- a/source/blender/editors/space_info/textview.h
+++ b/source/blender/editors/space_info/textview.h
@@ -48,7 +48,8 @@ typedef struct TextViewContext {
int (*step)(struct TextViewContext *tvc);
int (*line_get)(struct TextViewContext *tvc, const char **, int *);
int (*line_color)(struct TextViewContext *tvc, unsigned char fg[3], unsigned char bg[3]);
- void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]); /* constant theme colors */
+ /* constant theme colors */
+ void (*const_colors)(struct TextViewContext *tvc, unsigned char bg_sel[4]);
void *iter;
int iter_index;
int iter_char; /* char intex, used for multi-line report display */
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index d5d50c86851..3723f10b316 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -156,7 +156,8 @@ bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_p
id = ale->id;
}
else {
- /* ale->data is always the proper ID block we need, but ale->id may not be (i.e. for textures) */
+ /* ale->data is always the proper ID block we need,
+ * but ale->id may not be (i.e. for textures) */
id = (ID *)ale->data;
}
diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c
index 2bd5bafe2d4..f9a8ab29601 100644
--- a/source/blender/editors/space_nla/nla_channels.c
+++ b/source/blender/editors/space_nla/nla_channels.c
@@ -68,7 +68,8 @@
#include "nla_intern.h" // own include
/* *********************************************** */
-/* Operators for NLA channels-list which need to be different from the standard Animation Editor ones */
+/* Operators for NLA channels-list which need to be different
+ * from the standard Animation Editor ones */
/* ******************** Mouse-Click Operator *********************** */
/* Depending on the channel that was clicked on, the mouse click will activate whichever
@@ -260,7 +261,8 @@ static int mouse_nla_channels(bContext *C, bAnimContext *ac, float x, int channe
nlt->flag |= NLATRACK_SELECTED;
}
- /* if NLA-Track is selected now, make NLA-Track the 'active' one in the visible list */
+ /* if NLA-Track is selected now,
+ * make NLA-Track the 'active' one in the visible list */
if (nlt->flag & NLATRACK_SELECTED)
ANIM_set_active_channel(ac, ac->data, ac->datatype, filter, nlt, ANIMTYPE_NLATRACK);
@@ -557,7 +559,8 @@ static int nla_action_unlink_exec(bContext *C, wmOperator *op)
static int nla_action_unlink_invoke(bContext *C, wmOperator *op, const wmEvent *evt)
{
- /* NOTE: this is hardcoded to match the behavior for the unlink button (in interface_templates.c) */
+ /* NOTE: this is hardcoded to match the behavior for the unlink button
+ * (in interface_templates.c) */
RNA_boolean_set(op->ptr, "force_delete", evt->shift != 0);
return nla_action_unlink_exec(C, op);
}
@@ -614,7 +617,8 @@ bool nlaedit_add_tracks_existing(bAnimContext *ac, bool above_sel)
added = true;
}
else if ((lastAdt == NULL) || (adt != lastAdt)) {
- /* add one track to the top of the owning AnimData's stack, then don't add anymore to this stack */
+ /* add one track to the top of the owning AnimData's stack,
+ * then don't add anymore to this stack */
BKE_nlatrack_add(adt, NULL);
lastAdt = adt;
ale->update = ANIM_UPDATE_DEPS;
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index e71aee42a1e..96e6a0e479d 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -95,7 +95,8 @@ void nla_action_get_color(AnimData *adt, bAction *act, float color[4])
}
}
- /* when an NLA track is tagged "solo", action doesn't contribute, so shouldn't be as prominent */
+ /* when an NLA track is tagged "solo", action doesn't contribute,
+ * so shouldn't be as prominent */
if (adt && (adt->flag & ADT_NLA_SOLO_TRACK))
color[3] *= 0.15f;
}
@@ -339,7 +340,8 @@ static void nla_draw_strip_curves(NlaStrip *strip, float yminc, float ymaxc, uns
if ((IS_EQF(strip->blendin, 0.0f) && IS_EQF(strip->blendout, 0.0f)) == 0) {
immBeginAtMost(GPU_PRIM_LINE_STRIP, 4);
- /* start of strip - if no blendin, start straight at 1, otherwise from 0 to 1 over blendin frames */
+ /* start of strip - if no blendin, start straight at 1,
+ * otherwise from 0 to 1 over blendin frames */
if (IS_EQF(strip->blendin, 0.0f) == 0) {
immVertex2f(pos, strip->start, yminc);
immVertex2f(pos, strip->start + strip->blendin, ymaxc);
@@ -417,7 +419,8 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri
GPU_blend(true);
switch (strip->extendmode) {
- /* since this does both sides, only do the 'before' side, and leave the rest to the next case */
+ /* since this does both sides,
+ * only do the 'before' side, and leave the rest to the next case */
case NLASTRIP_EXTEND_HOLD:
/* only need to draw here if there's no strip before since
* it only applies in such a situation
@@ -479,7 +482,8 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri
immUnbindProgram();
- /* draw markings indicating locations of local markers (useful for lining up different actions) */
+ /* draw markings indicating locations of local markers
+ * (useful for lining up different actions) */
if ((snla->flag & SNLA_NOLOCALMARKERS) == 0)
nla_strip_draw_markers(strip, yminc, ymaxc);
@@ -532,11 +536,13 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri
}
immEnd();
}
- /* or if meta-strip, draw lines delimiting extents of sub-strips (in same color as outline, if more than 1 exists) */
+ /* or if meta-strip, draw lines delimiting extents of sub-strips
+ * (in same color as outline, if more than 1 exists) */
else if ((strip->type == NLASTRIP_TYPE_META) && (strip->strips.first != strip->strips.last)) {
const float y = (ymaxc - yminc) * 0.5f + yminc;
- immBeginAtMost(GPU_PRIM_LINES, 4 * BLI_listbase_count(&strip->strips)); /* up to 2 lines per strip */
+ /* up to 2 lines per strip */
+ immBeginAtMost(GPU_PRIM_LINES, 4 * BLI_listbase_count(&strip->strips));
/* only draw first-level of child-strips, but don't draw any lines on the endpoints */
for (NlaStrip *cs = strip->strips.first; cs; cs = cs->next) {
@@ -798,7 +804,8 @@ void draw_nla_channel_list(const bContext *C, bAnimContext *ac, ARegion *ar)
* (NOTE: this is ok here, the configuration is pretty straightforward)
*/
v2d->tot.ymin = (float)(-height);
- /* need to do a view-sync here, so that the keys area doesn't jump around (it must copy this) */
+ /* need to do a view-sync here, so that the keys area doesn't jump around
+ * (it must copy this) */
UI_view2d_sync(NULL, ac->sa, v2d, V2D_LOCK_COPY);
/* draw channels */
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index 3cab4cfefca..5d88714ee76 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -418,7 +418,8 @@ static bool nla_channels_get_selected_extents(bAnimContext *ac, float *min, floa
SpaceNla *snla = (SpaceNla *)ac->sl;
const float half_height = NLACHANNEL_HEIGHT_HALF(snla);
- short found = 0; /* NOTE: not bool, since we want prioritise individual channels over expanders */
+ /* NOTE: not bool, since we want prioritise individual channels over expanders */
+ short found = 0;
float y;
/* get all items - we need to do it this way */
@@ -480,7 +481,8 @@ static int nlaedit_viewall(bContext *C, const bool only_sel)
/* set vertical range */
if (only_sel == false) {
- /* view all -> the summary channel is usually the shows everything, and resides right at the top... */
+ /* view all -> the summary channel is usually the shows everything,
+ * and resides right at the top... */
v2d->cur.ymax = 0.0f;
v2d->cur.ymin = (float)-BLI_rcti_size_y(&v2d->mask);
}
@@ -580,7 +582,8 @@ void NLA_OT_view_frame(wmOperatorType *ot)
/* NLA Editing Operations (Constructive/Destructive) */
/* ******************** Add Action-Clip Operator ***************************** */
-/* Add a new Action-Clip strip to the active track (or the active block if no space in the track) */
+/* Add a new Action-Clip strip to the active track
+ * (or the active block if no space in the track) */
/* add the specified action as new strip */
@@ -614,7 +617,8 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
else if (act->idroot == 0) {
- /* hopefully in this case (i.e. library of userless actions), the user knows what they're doing... */
+ /* hopefully in this case (i.e. library of userless actions),
+ * the user knows what they're doing... */
BKE_reportf(op->reports, RPT_WARNING,
"Action '%s' does not specify what data-blocks it can be used on "
"(try setting the 'ID Root Type' setting from the data-blocks editor "
@@ -639,7 +643,8 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED;
}
- /* for every active track, try to add strip to free space in track or to the top of the stack if no space */
+ /* for every active track,
+ * try to add strip to free space in track or to the top of the stack if no space */
for (ale = anim_data.first; ale; ale = ale->next) {
NlaTrack *nlt = (NlaTrack *)ale->data;
AnimData *adt = ale->adt;
@@ -1078,7 +1083,8 @@ static int nlaedit_duplicate_exec(bContext *C, wmOperator *op)
/* make a copy (assume that this is possible) */
nstrip = BKE_nlastrip_copy(ac.bmain, strip, linked, 0);
- /* in case there's no space in the track above, or we haven't got a reference to it yet, try adding */
+ /* in case there's no space in the track above,
+ * or we haven't got a reference to it yet, try adding */
if (BKE_nlatrack_add_strip(nlt->next, nstrip) == 0) {
/* need to add a new track above the one above the current one
* - if the current one is the last one, nlt->next will be NULL, which defaults to adding
@@ -1509,7 +1515,8 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op)
nlt->name);
}
else if (sa == NULL) {
- /* no warning as this is just a common case, and it may get annoying when doing multiple tracks */
+ /* no warning as this is just a common case,
+ * and it may get annoying when doing multiple tracks */
}
else if (sb == NULL) {
/* too few selected warning */
@@ -1520,7 +1527,8 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op)
else {
float nsa[2], nsb[2];
- /* remove these strips from the track, so that we can test if they can fit in the proposed places */
+ /* remove these strips from the track,
+ * so that we can test if they can fit in the proposed places */
BLI_remlink(&nlt->strips, sa);
BLI_remlink(&nlt->strips, sb);
@@ -1633,7 +1641,8 @@ static int nlaedit_move_up_exec(bContext *C, wmOperator *UNUSED(op))
if (strip->flag & NLASTRIP_FLAG_SELECT) {
/* check if the track above has room for this strip */
if (BKE_nlatrack_has_space(nltn, strip->start, strip->end)) {
- /* remove from its current track, and add to the one above (it 'should' work, so no need to worry) */
+ /* remove from its current track, and add to the one above
+ * (it 'should' work, so no need to worry) */
BLI_remlink(&nlt->strips, strip);
BKE_nlatrack_add_strip(nltn, strip);
}
@@ -1707,7 +1716,8 @@ static int nlaedit_move_down_exec(bContext *C, wmOperator *UNUSED(op))
if (strip->flag & NLASTRIP_FLAG_SELECT) {
/* check if the track below has room for this strip */
if (BKE_nlatrack_has_space(nltp, strip->start, strip->end)) {
- /* remove from its current track, and add to the one above (it 'should' work, so no need to worry) */
+ /* remove from its current track, and add to the one above
+ * (it 'should' work, so no need to worry) */
BLI_remlink(&nlt->strips, strip);
BKE_nlatrack_add_strip(nltp, strip);
}
@@ -1953,23 +1963,27 @@ static int nlaedit_apply_scale_exec(bContext *C, wmOperator *UNUSED(op))
NlaStrip *strip;
for (strip = nlt->strips.first; strip; strip = strip->next) {
- /* strip must be selected, and must be action-clip only (transitions don't have scale) */
+ /* strip must be selected, and must be action-clip only
+ * (transitions don't have scale) */
if ((strip->flag & NLASTRIP_FLAG_SELECT) && (strip->type == NLASTRIP_TYPE_CLIP)) {
- /* if the referenced action is used by other strips, make this strip use its own copy */
+ /* if the referenced action is used by other strips,
+ * make this strip use its own copy */
if (strip->act == NULL)
continue;
if (strip->act->id.us > 1) {
/* make a copy of the Action to work on */
bAction *act = BKE_action_copy(bmain, strip->act);
- /* set this as the new referenced action, decrementing the users of the old one */
+ /* set this as the new referenced action,
+ * decrementing the users of the old one */
id_us_min(&strip->act->id);
strip->act = act;
copied = true;
}
- /* setup iterator, and iterate over all the keyframes in the action, applying this scaling */
+ /* setup iterator, and iterate over all the keyframes in the action,
+ * applying this scaling */
ked.data = strip;
ANIM_animchanneldata_keyframes_loop(&ked, ac.ads, strip->act, ALE_ACT, NULL, bezt_apply_nlamapping, calchandles_fcurve);
@@ -2040,7 +2054,8 @@ static int nlaedit_clear_scale_exec(bContext *C, wmOperator *UNUSED(op))
NlaStrip *strip;
for (strip = nlt->strips.first; strip; strip = strip->next) {
- /* strip must be selected, and must be action-clip only (transitions don't have scale) */
+ /* strip must be selected, and must be action-clip only
+ * (transitions don't have scale) */
if ((strip->flag & NLASTRIP_FLAG_SELECT) && (strip->type == NLASTRIP_TYPE_CLIP)) {
PointerRNA strip_ptr;
@@ -2182,7 +2197,8 @@ static int nlaedit_snap_exec(bContext *C, wmOperator *op)
track = BKE_nlatrack_add(adt, nlt);
BKE_nlatrack_add_strip(track, strip);
- /* clear temp meta-strips on this new track, as we may not be able to get back to it */
+ /* clear temp meta-strips on this new track,
+ * as we may not be able to get back to it */
BKE_nlastrips_clear_metas(&track->strips, 0, 1);
}
}
diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c
index db7f5d707d2..a49c5577451 100644
--- a/source/blender/editors/space_nla/nla_select.c
+++ b/source/blender/editors/space_nla/nla_select.c
@@ -536,7 +536,8 @@ static void mouse_nla_strips(bContext *C, bAnimContext *ac, const int mval[2], s
float x, y;
- /* use View2D to determine the index of the channel (i.e a row in the list) where keyframe was */
+ /* use View2D to determine the index of the channel
+ * (i.e a row in the list) where keyframe was */
UI_view2d_region_to_view(v2d, mval[0], mval[1], &x, &y);
UI_view2d_listview_view_to_cell(v2d, 0, NLACHANNEL_STEP(snla), 0, (float)NLACHANNEL_HEIGHT_HALF(snla), x, y, NULL, &channel_index);
@@ -563,14 +564,16 @@ static void mouse_nla_strips(bContext *C, bAnimContext *ac, const int mval[2], s
if (ale->type == ANIMTYPE_NLATRACK) {
NlaTrack *nlt = (NlaTrack *)ale->data;
- /* loop over NLA-strips in this track, trying to find one which occurs in the necessary bounds */
+ /* loop over NLA-strips in this track,
+ * trying to find one which occurs in the necessary bounds */
for (strip = nlt->strips.first; strip; strip = strip->next) {
if (BKE_nlastrip_within_bounds(strip, xmin, xmax))
break;
}
}
- /* remove active channel from list of channels for separate treatment (since it's needed later on) */
+ /* remove active channel from list of channels for separate treatment
+ * (since it's needed later on) */
BLI_remlink(&anim_data, ale);
/* free list of channels, since it's not used anymore */
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 38714c6bd4b..b7b75d34470 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -162,7 +162,8 @@ static void node_buts_curvevec(uiLayout *layout, bContext *UNUSED(C), PointerRNA
}
#define SAMPLE_FLT_ISNONE FLT_MAX
-static float _sample_col[4] = {SAMPLE_FLT_ISNONE}; /* bad bad, 2.5 will do better?... no it won't... */
+/* bad bad, 2.5 will do better?... no it won't... */
+static float _sample_col[4] = {SAMPLE_FLT_ISNONE};
void ED_node_sample_set(const float col[4])
{
if (col) {
@@ -362,7 +363,8 @@ static void node_draw_frame_label(bNodeTree *ntree, bNode *node, const float asp
BLF_enable(fontid, BLF_ASPECT);
BLF_aspect(fontid, aspect, aspect, 1.0f);
- BLF_size(fontid, MIN2(24, font_size), U.dpi); /* clamp otherwise it can suck up a LOT of memory */
+ /* clamp otherwise it can suck up a LOT of memory */
+ BLF_size(fontid, MIN2(24, font_size), U.dpi);
/* title color */
UI_GetThemeColorBlendShade3ubv(TH_TEXT, color_id, 0.4f, 10, color);
@@ -652,7 +654,8 @@ static void node_buts_image_user(uiLayout *layout, bContext *C, PointerRNA *ptr,
source = RNA_enum_get(imaptr, "source");
if (source == IMA_SRC_SEQUENCE) {
- /* don't use iuser->framenr directly because it may not be updated if auto-refresh is off */
+ /* don't use iuser->framenr directly
+ * because it may not be updated if auto-refresh is off */
Scene *scene = CTX_data_scene(C);
ImageUser *iuser = iuserptr->data;
/* Image *ima = imaptr->data; */ /* UNUSED */
@@ -1805,7 +1808,8 @@ static void node_composit_buts_file_output_ex(uiLayout *layout, bContext *C, Poi
RNA_property_collection_lookup_int(ptr, RNA_struct_find_property(ptr, "file_slots"),
active_index, &active_input_ptr);
}
- /* XXX collection lookup does not return the ID part of the pointer, setting this manually here */
+ /* XXX collection lookup does not return the ID part of the pointer,
+ * setting this manually here */
active_input_ptr.id.data = ptr->id.data;
col = uiLayoutColumn(row, true);
@@ -2903,7 +2907,7 @@ static void node_texture_set_butfunc(bNodeType *ntype)
}
}
-/* ******* init draw callbacks for all tree types, only called in usiblender.c, once ************* */
+/* ****** init draw callbacks for all tree types, only called in usiblender.c, once ************ */
static void node_property_update_default(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
@@ -3054,7 +3058,8 @@ static void std_node_socket_interface_draw_color(bContext *UNUSED(C), PointerRNA
copy_v4_v4(r_color, std_node_socket_colors[type]);
}
-/* draw function for file output node sockets, displays only sub-path and format, no value button */
+/* draw function for file output node sockets,
+ * displays only sub-path and format, no value button */
static void node_file_output_socket_draw(bContext *C, uiLayout *layout, PointerRNA *ptr, PointerRNA *node_ptr)
{
bNodeTree *ntree = ptr->id.data;
@@ -3532,7 +3537,8 @@ static void nodelink_batch_init(void)
g_batch_link.p3_id = GPU_vertformat_attr_add(&format_inst, "P3", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
g_batch_link.colid_id = GPU_vertformat_attr_add(&format_inst, "colid_doarrow", GPU_COMP_U8, 4, GPU_FETCH_INT);
g_batch_link.inst_vbo = GPU_vertbuf_create_with_format_ex(&format_inst, GPU_USAGE_STREAM);
- GPU_vertbuf_data_alloc(g_batch_link.inst_vbo, NODELINK_GROUP_SIZE); /* Alloc max count but only draw the range we need. */
+ /* Alloc max count but only draw the range we need. */
+ GPU_vertbuf_data_alloc(g_batch_link.inst_vbo, NODELINK_GROUP_SIZE);
GPU_batch_instbuf_set(g_batch_link.batch, g_batch_link.inst_vbo, true);
diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c
index 8ec6d9332d3..4b85b146e7e 100644
--- a/source/blender/editors/space_node/node_draw.c
+++ b/source/blender/editors/space_node/node_draw.c
@@ -195,7 +195,8 @@ static bool compare_nodes(const bNode *a, const bNode *b)
bool a_active = (a->flag & NODE_ACTIVE) != 0, b_active = (b->flag & NODE_ACTIVE) != 0;
/* if one is an ancestor of the other */
- /* XXX there might be a better sorting algorithm for stable topological sort, this is O(n^2) worst case */
+ /* XXX there might be a better sorting algorithm for stable topological sort,
+ * this is O(n^2) worst case */
for (parent = a->parent; parent; parent = parent->parent) {
/* if b is an ancestor, it is always behind a */
if (parent == b)
@@ -713,7 +714,8 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv)
node_draw_preview_background(BLI_rctf_size_x(prv) / 10.0f, &draw_rect);
GPU_blend(true);
- GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA); /* premul graphics */
+ /* premul graphics */
+ GPU_blend_set_func_separate(GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
immDrawPixelsTex(&state, draw_rect.xmin, draw_rect.ymin, preview->xsize, preview->ysize, GL_RGBA, GL_UNSIGNED_BYTE, GL_LINEAR, preview->rect,
@@ -967,8 +969,9 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
nodeLabel(ntree, node, showname, sizeof(showname));
+ /* XXX - don't print into self! */
//if (node->flag & NODE_MUTED)
- // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); /* XXX - don't print into self! */
+ // BLI_snprintf(showname, sizeof(showname), "[%s]", showname);
uiDefBut(node->block, UI_BTYPE_LABEL, 0, showname,
(int)(rct->xmin + (NODE_MARGIN_X)), (int)(rct->ymax - NODE_DY),
@@ -976,8 +979,10 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN
NULL, 0, 0, 0, 0, "");
/* body */
- if (!nodeIsRegistered(node))
- UI_GetThemeColor4fv(TH_REDALERT, color); /* use warning color to indicate undefined types */
+ if (!nodeIsRegistered(node)) {
+ /* use warning color to indicate undefined types */
+ UI_GetThemeColor4fv(TH_REDALERT, color);
+ }
else if (node->flag & NODE_CUSTOM_COLOR) {
rgba_float_args_set(color, node->color[0], node->color[1], node->color[2], 1.0f);
}
@@ -1092,8 +1097,9 @@ static void node_draw_hidden(const bContext *C, ARegion *ar, SpaceNode *snode, b
if (node->miniwidth > 0.0f) {
nodeLabel(ntree, node, showname, sizeof(showname));
+ /* XXX - don't print into self! */
//if (node->flag & NODE_MUTED)
- // BLI_snprintf(showname, sizeof(showname), "[%s]", showname); /* XXX - don't print into self! */
+ // BLI_snprintf(showname, sizeof(showname), "[%s]", showname);
uiDefBut(node->block, UI_BTYPE_LABEL, 0, showname,
round_fl_to_int(rct->xmin + NODE_MARGIN_X), round_fl_to_int(centy - NODE_DY * 0.5f),
diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c
index 9a6a75d4f61..875cb22fb16 100644
--- a/source/blender/editors/space_node/node_edit.c
+++ b/source/blender/editors/space_node/node_edit.c
@@ -1947,7 +1947,8 @@ static int node_clipboard_copy_exec(bContext *C, wmOperator *UNUSED(op))
/* ensure valid pointers */
if (new_node->parent) {
- /* parent pointer must be redirected to new node or detached if parent is not copied */
+ /* parent pointer must be redirected to new node or detached if parent is
+ * not copied */
if (new_node->parent->flag & NODE_SELECT) {
new_node->parent = new_node->parent->new_node;
}
diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c
index e024a76c707..91bb95c9cb4 100644
--- a/source/blender/editors/space_node/node_group.c
+++ b/source/blender/editors/space_node/node_group.c
@@ -258,7 +258,8 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
LinkData *ld, *ldn = NULL;
bAction *waction;
- /* firstly, wgroup needs to temporary dummy action that can be destroyed, as it shares copies */
+ /* firstly, wgroup needs to temporary dummy action
+ * that can be destroyed, as it shares copies */
waction = wgroup->adt->action = BKE_action_copy(bmain, wgroup->adt->action);
/* now perform the moving */
@@ -307,7 +308,9 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
/* XXX TODO bNodeSocket *sock = node_group_find_input_socket(gnode, identifier);
BLI_assert(sock);*/
- /* XXX TODO nodeSocketCopy(ntree, link->tosock->new_sock, link->tonode->new_node, ntree, sock, gnode);*/
+ /* XXX TODO
+ * nodeSocketCopy(ntree, link->tosock->new_sock, link->tonode->new_node,
+ * ntree, sock, gnode);*/
}
}
}
@@ -335,7 +338,8 @@ static int node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode)
/* XXX TODO bNodeSocket *sock = node_group_find_output_socket(gnode, identifier);
BLI_assert(sock);*/
- /* XXX TODO nodeSocketCopy(ntree, link->tosock, link->tonode, ntree, sock, gnode); */
+ /* XXX TODO
+ * nodeSocketCopy(ntree, link->tosock, link->tonode, ntree, sock, gnode); */
}
}
}
@@ -963,7 +967,9 @@ static int node_group_make_exec(bContext *C, wmOperator *op)
snode_notify(C, snode);
snode_dag_update(C, snode);
- DEG_relations_tag_update(bmain); /* We broke relations in node tree, need to rebuild them in the grahes. */
+
+ /* We broke relations in node tree, need to rebuild them in the grahes. */
+ DEG_relations_tag_update(bmain);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h
index 9cff6b7880e..a74daae12b3 100644
--- a/source/blender/editors/space_node/node_intern.h
+++ b/source/blender/editors/space_node/node_intern.h
@@ -64,7 +64,8 @@ typedef struct bNodeLinkDrag {
ARegion *node_has_buttons_region(ScrArea *sa);
ARegion *node_has_tools_region(ScrArea *sa);
-void snode_group_offset(struct SpaceNode *snode, float *x, float *y); /* transform between View2Ds in the tree path */
+/* transform between View2Ds in the tree path */
+void snode_group_offset(struct SpaceNode *snode, float *x, float *y);
/* node_draw.c */
int node_get_colorid(struct bNode *node);
diff --git a/source/blender/editors/space_node/node_relationships.c b/source/blender/editors/space_node/node_relationships.c
index 8f3d3d8a4b3..368bc0fd4b3 100644
--- a/source/blender/editors/space_node/node_relationships.c
+++ b/source/blender/editors/space_node/node_relationships.c
@@ -1179,7 +1179,8 @@ static int node_join_exec(bContext *C, wmOperator *UNUSED(op))
bNodeTree *ntree = snode->edittree;
bNode *node, *frame;
- /* XXX save selection: node_add_node call below sets the new frame as single active+selected node */
+ /* XXX save selection: node_add_node call below sets the new frame as single
+ * active+selected node */
for (node = ntree->nodes.first; node; node = node->next) {
if (node->flag & NODE_SELECT)
node->flag |= NODE_TEST;
@@ -1455,11 +1456,13 @@ void ED_node_link_intersect_test(ScrArea *sa, int test)
float dist = FLT_MAX;
int i;
- /* loop over link coords to find shortest dist to upper left node edge of a intersected line segment */
+ /* loop over link coords to find shortest dist to
+ * upper left node edge of a intersected line segment */
for (i = 0; i < NODE_LINK_RESOL; i++) {
/* check if the node rect intersetcts the line from this point to next one */
if (BLI_rctf_isect_segment(&select->totr, coord_array[i], coord_array[i + 1])) {
- /* store the shortest distance to the upper left edge of all intersetctions found so far */
+ /* store the shortest distance to the upper left edge
+ * of all intersetctions found so far */
const float node_xy[] = {select->totr.xmin, select->totr.ymax};
/* to be precise coord_array should be clipped by select->totr,
@@ -1645,10 +1648,12 @@ static void node_link_insert_offset_ntree(
/* NODE_TEST will be used later, so disable for all nodes */
ntreeNodeFlagSet(ntree, NODE_TEST, false);
- /* insert->totr isn't updated yet, so totr_insert is used to get the correct worldspace coords */
+ /* insert->totr isn't updated yet,
+ * so totr_insert is used to get the correct worldspace coords */
node_to_updated_rect(insert, &totr_insert);
- /* frame attachment wasn't handled yet so we search the frame that the node will be attached to later */
+ /* frame attachment wasn't handled yet
+ * so we search the frame that the node will be attached to later */
insert->parent = node_find_frame_to_attach(ar, ntree, mouse_xy);
/* this makes sure nodes are also correctly offset when inserting a node on top of a frame
diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c
index e7a9db20103..76cd7700216 100644
--- a/source/blender/editors/space_node/node_templates.c
+++ b/source/blender/editors/space_node/node_templates.c
@@ -499,7 +499,8 @@ static void ui_node_menu_column(NodeLinkArg *arg, int nclass, const char *cname)
if (num > 1) {
if (!cur_node_name || !STREQ(cur_node_name, items[i].node_name)) {
cur_node_name = items[i].node_name;
- /* XXX Do not use uiItemL here, it would add an empty icon as we are in a menu! */
+ /* XXX Do not use uiItemL here,
+ * it would add an empty icon as we are in a menu! */
uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_(cur_node_name), 0, 0, UI_UNIT_X * 4, UI_UNIT_Y,
NULL, 0.0, 0.0, 0.0, 0.0, "");
}
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index cbd67bfb722..00cd6ca2a6e 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -670,7 +670,8 @@ static void node_main_region_draw(const bContext *C, ARegion *ar)
static bool node_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip))
{
if (drag->type == WM_DRAG_PATH) {
- return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE)); /* rule might not work? */
+ /* rule might not work? */
+ return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE));
}
else {
return WM_drag_ID(drag, ID_IM) != NULL;
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 9bdbcf6ed4e..6c8d95c22fd 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -2185,7 +2185,8 @@ void draw_outliner(const bContext *C)
has_restrict_icons = false;
}
else {
- /* width must take into account restriction columns (if visible) so that entries will still be visible */
+ /* width must take into account restriction columns (if visible)
+ * so that entries will still be visible */
//outliner_width(soops, &soops->tree, &sizex);
// XXX should use outliner_width instead when te->xend will be set correctly...
outliner_rna_width(soops, &soops->tree, &sizex, 0);
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 7926081c38d..37f41cbf207 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -486,7 +486,8 @@ static int outliner_id_remap_exec(bContext *C, wmOperator *op)
/* recreate dependency graph to include new objects */
DEG_relations_tag_update(bmain);
- /* free gpu materials, some materials depend on existing objects, such as lamps so freeing correctly refreshes */
+ /* free gpu materials, some materials depend on existing objects,
+ * such as lamps so freeing correctly refreshes */
GPU_materials_free(bmain);
WM_event_add_notifier(C, NC_WINDOW, NULL);
@@ -705,7 +706,8 @@ void OUTLINER_OT_lib_relocate(wmOperatorType *ot)
}
/* XXX This does not work with several items
- * (it is only called once in the end, due to the 'deferred' filebrowser invocation through event system...). */
+ * (it is only called once in the end, due to the 'deferred'
+ * filebrowser invocation through event system...). */
void lib_relocate_cb(
bContext *C, ReportList *UNUSED(reports), Scene *UNUSED(scene), TreeElement *te,
TreeStoreElem *UNUSED(tsep), TreeStoreElem *tselem, void *UNUSED(user_data))
diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h
index d6ebddf94e2..f8c32375bdf 100644
--- a/source/blender/editors/space_outliner/outliner_intern.h
+++ b/source/blender/editors/space_outliner/outliner_intern.h
@@ -92,7 +92,8 @@ typedef struct TreeElementIcon {
#define TREESTORE_ID_TYPE(_id) \
(ELEM(GS((_id)->name), ID_SCE, ID_LI, ID_OB, ID_ME, ID_CU, ID_MB, ID_NT, ID_MA, ID_TE, ID_IM, ID_LT, ID_LA, ID_CA) || \
ELEM(GS((_id)->name), ID_KE, ID_WO, ID_SPK, ID_GR, ID_AR, ID_AC, ID_BR, ID_PA, ID_GD, ID_LS, ID_LP) || \
- ELEM(GS((_id)->name), ID_SCR, ID_WM, ID_TXT, ID_VF, ID_SO, ID_CF, ID_PAL, ID_MC, ID_WS, ID_MSK)) /* Only in 'blendfile' mode ... :/ */
+ /* Only in 'blendfile' mode ... :/ */ \
+ ELEM(GS((_id)->name), ID_SCR, ID_WM, ID_TXT, ID_VF, ID_SO, ID_CF, ID_PAL, ID_MC, ID_WS, ID_MSK))
/* TreeElement->flag */
enum {
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index a4bcb612e9e..1a84d6bd142 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -304,7 +304,8 @@ static eOLDrawState tree_element_set_active_object(
/* Only in object mode so we can switch the active object,
* keeping all objects in the current 'mode' selected, useful for multi-pose/edit mode.
- * This keeps the convention that all objects in the current mode are also selected. see T55246. */
+ * This keeps the convention that all objects in the current mode are also selected.
+ * see T55246. */
if ((scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) ? (ob->mode == OB_MODE_OBJECT) : true) {
BKE_view_layer_base_deselect_all(view_layer);
}
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index 5df9d5f4ac4..10d2e15505e 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -779,7 +779,10 @@ static void constraint_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tsel
if (BKE_constraint_remove_ex(lb, ob, constraint, true)) {
/* there's no active constraint now, so make sure this is the case */
BKE_constraints_active_set(&ob->constraints, NULL);
- ED_object_constraint_update(bmain, ob); /* needed to set the flags on posebones correctly */
+
+ /* needed to set the flags on posebones correctly */
+ ED_object_constraint_update(bmain, ob);
+
WM_event_add_notifier(C, NC_OBJECT | ND_CONSTRAINT | NA_REMOVED, ob);
te->store_elem->flag &= ~TSE_SELECTED;
}
diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c
index 9ac96cf4929..f069c259dd1 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -1935,7 +1935,8 @@ void outliner_build_tree(Main *mainvar, Scene *scene, ViewLayer *view_layer, Spa
{
TreeElement *te = NULL, *ten;
TreeStoreElem *tselem;
- int show_opened = !soops->treestore || !BLI_mempool_len(soops->treestore); /* on first view, we open scenes */
+ /* on first view, we open scenes */
+ int show_opened = !soops->treestore || !BLI_mempool_len(soops->treestore);
/* Are we looking for something - we want to tag parents to filter child matches
* - NOT in datablocks view - searching all datablocks takes way too long to be useful
diff --git a/source/blender/editors/space_outliner/outliner_utils.c b/source/blender/editors/space_outliner/outliner_utils.c
index 6b7035dd326..081fa9f9e94 100644
--- a/source/blender/editors/space_outliner/outliner_utils.c
+++ b/source/blender/editors/space_outliner/outliner_utils.c
@@ -73,10 +73,13 @@ TreeElement *outliner_find_item_at_y(const SpaceOops *soops, const ListBase *tre
*/
TreeElement *outliner_find_item_at_x_in_row(const SpaceOops *soops, const TreeElement *parent_te, float view_co_x)
{
- if (!TSELEM_OPEN(TREESTORE(parent_te), soops)) { /* if parent_te is opened, it doesn't show childs in row */
+ /* if parent_te is opened, it doesn't show childs in row */
+ if (!TSELEM_OPEN(TREESTORE(parent_te), soops)) {
/* no recursion, items can only display their direct children in the row */
for (TreeElement *child_te = parent_te->subtree.first;
- child_te && view_co_x >= child_te->xs; /* don't look further if co_x is smaller than child position*/
+ /* don't look further if co_x is smaller than child position*/
+ child_te && view_co_x >= child_te->xs;
+
child_te = child_te->next)
{
if ((child_te->flag & TE_ICONROW) && (view_co_x > child_te->xs) && (view_co_x < child_te->xend)) {
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index a9ae158d162..5452bd9cc80 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -93,18 +93,26 @@ static void sequencer_generic_props__internal(wmOperatorType *ot, int flag)
{
PropertyRNA *prop;
- if (flag & SEQPROP_STARTFRAME)
- RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX, "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX);
+ if (flag & SEQPROP_STARTFRAME) {
+ RNA_def_int(ot->srna, "frame_start", 0, INT_MIN, INT_MAX,
+ "Start Frame", "Start frame of the sequence strip", INT_MIN, INT_MAX);
+ }
- if (flag & SEQPROP_ENDFRAME)
- RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX, "End Frame", "End frame for the color strip", INT_MIN, INT_MAX); /* not usual since most strips have a fixed length */
+ if (flag & SEQPROP_ENDFRAME) {
+ /* not usual since most strips have a fixed length */
+ RNA_def_int(ot->srna, "frame_end", 0, INT_MIN, INT_MAX,
+ "End Frame", "End frame for the color strip", INT_MIN, INT_MAX);
+ }
- RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ, "Channel", "Channel to place this strip into", 1, MAXSEQ);
+ RNA_def_int(ot->srna, "channel", 1, 1, MAXSEQ,
+ "Channel", "Channel to place this strip into", 1, MAXSEQ);
- RNA_def_boolean(ot->srna, "replace_sel", 1, "Replace Selection", "Replace the current selection");
+ 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 */
- prop = RNA_def_boolean(ot->srna, "overlap", 0, "Allow Overlap", "Don't correct overlap on new sequence strips");
+ 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);
}
@@ -190,11 +198,13 @@ static void seq_load_operator_info(SeqLoadInfo *seq_load, bContext *C, wmOperato
seq_load->len = 1; // images only, if endframe isn't set!
if ((prop = RNA_struct_find_property(op->ptr, "filepath"))) {
- RNA_property_string_get(op->ptr, prop, seq_load->path); /* 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"))) {
- RNA_property_string_get(op->ptr, prop, seq_load->path); /* 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;
}
@@ -249,7 +259,8 @@ 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 */
+ /* operator custom data is always released after the SeqLoadInfo,
+ * no need to handle the memory here */
seq_load->stereo3d_format = &imf->stereo3d_format;
}
}
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 9593ca4a6e3..38243638943 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -648,7 +648,8 @@ static void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq, u
immUniformColor3ubvAlpha(col, col[3] + 50);
- imm_draw_box_wire_2d(pos, (float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM, x1, y1); /* outline */
+ /* outline */
+ imm_draw_box_wire_2d(pos, (float)(seq->start), y1 - SEQ_STRIP_OFSBOTTOM, x1, y1);
}
if (seq->endofs) {
immUniformColor4ubv(col);
@@ -656,7 +657,8 @@ static void draw_sequence_extensions(Scene *scene, ARegion *ar, Sequence *seq, u
immUniformColor3ubvAlpha(col, col[3] + 50);
- imm_draw_box_wire_2d(pos, x2, y2, (float)(seq->start + seq->len), y2 + SEQ_STRIP_OFSBOTTOM); /* outline */
+ /* outline */
+ imm_draw_box_wire_2d(pos, x2, y2, (float)(seq->start + seq->len), y2 + SEQ_STRIP_OFSBOTTOM);
}
if (seq->startofs || seq->endofs) {
@@ -1565,7 +1567,8 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
/* loop through twice, first unselected, then selected */
for (j = 0; j < 2; j++) {
Sequence *seq;
- int outline_tint = (j) ? -60 : -150; /* highlighting around strip edges indicating selection */
+ /* highlighting around strip edges indicating selection */
+ int outline_tint = (j) ? -60 : -150;
/* loop through strips, checking for those that are visible */
for (seq = ed->seqbasep->first; seq; seq = seq->next) {
@@ -1585,7 +1588,8 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *ar)
sel = SELECT;
}
- /* draw the last selected last (i.e. 'active' in other parts of Blender), removes some overlapping error */
+ /* draw the last selected last (i.e. 'active' in other parts of Blender),
+ * removes some overlapping error */
if (last_seq)
draw_seq_strip(C, sseq, scene, ar, last_seq, 120, pixelx);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index f0d5d6d00f7..8c3639344f3 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -402,9 +402,11 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[
handsize = seq->handsize;
displen = (float)abs(seq->startdisp - seq->enddisp);
- if (displen / pixelx > 16) { /* don't even try to grab the handles of small strips */
- /* Set the max value to handle to 1/3 of the total len when its less than 28.
- * This is important because otherwise selecting handles happens even when you click in the middle */
+ /* don't even try to grab the handles of small strips */
+ if (displen / pixelx > 16) {
+ /* Set the max value to handle to 1/3 of the total len when its
+ * less than 28. This is important because otherwise selecting
+ * handles happens even when you click in the middle. */
if ((displen / 3) < 30 * pixelx) {
handsize = displen / 3;
@@ -2401,7 +2403,8 @@ static int sequencer_separate_images_exec(bContext *C, wmOperator *op)
strip_new->us = 1;
/* new stripdata (only one element now!) */
- /* Note this assume all elements (images) have the same dimension, since we only copy the name here. */
+ /* Note this assume all elements (images) have the same dimension,
+ * since we only copy the name here. */
se_new = MEM_reallocN(strip_new->stripdata, sizeof(*se_new));
BLI_strncpy(se_new->name, se->name, sizeof(se_new->name));
strip_new->stripdata = se_new;
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 433f1ca8ee5..fcd192fe7bc 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -351,7 +351,8 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, const wmEvent *e
marker->flag |= SELECT;
}
else {
- /* deselect_markers(0, 0); */ /* XXX, in 2.4x, seq selection used to deselect all, need to re-thnik this for 2.5 */
+ /* XXX, in 2.4x, seq selection used to deselect all, need to re-thnik this for 2.5 */
+ /* deselect_markers(0, 0); */
marker->flag |= SELECT;
}
diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c
index 4f6a3bc82ba..f3433352d54 100644
--- a/source/blender/editors/space_text/text_autocomplete.c
+++ b/source/blender/editors/space_text/text_autocomplete.c
@@ -194,7 +194,8 @@ static GHash *text_autocomplete_build(Text *text)
str_sub[choice_len] = '\0';
if (!BLI_ghash_lookup(gh, str_sub)) {
char *str_dup = BLI_strdupn(str_sub, choice_len);
- BLI_ghash_insert(gh, str_dup, str_dup); /* A 'set' would make more sense here */
+ /* A 'set' would make more sense here */
+ BLI_ghash_insert(gh, str_dup, str_dup);
}
str_sub[choice_len] = str_sub_last;
}
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c
index 765bfbd9b83..fd7d2c92db9 100644
--- a/source/blender/editors/space_text/text_draw.c
+++ b/source/blender/editors/space_text/text_draw.c
@@ -562,13 +562,21 @@ static void text_update_drawcache(SpaceText *st, ARegion *ar)
nlines = drawcache->nlines;
/* check if full cache update is needed */
- full_update |= drawcache->winx != ar->winx; /* area was resized */
- full_update |= drawcache->wordwrap != st->wordwrap; /* word-wrapping option was toggled */
- full_update |= drawcache->showlinenrs != st->showlinenrs; /* word-wrapping option was toggled */
- full_update |= drawcache->tabnumber != st->tabnumber; /* word-wrapping option was toggled */
- full_update |= drawcache->lheight != st->lheight_dpi; /* word-wrapping option was toggled */
- full_update |= drawcache->cwidth != st->cwidth; /* word-wrapping option was toggled */
- full_update |= !STREQLEN(drawcache->text_id, txt->id.name, MAX_ID_NAME); /* text datablock was changed */
+
+ /* area was resized */
+ full_update |= drawcache->winx != ar->winx;
+ /* word-wrapping option was toggled */
+ full_update |= drawcache->wordwrap != st->wordwrap;
+ /* word-wrapping option was toggled */
+ full_update |= drawcache->showlinenrs != st->showlinenrs;
+ /* word-wrapping option was toggled */
+ full_update |= drawcache->tabnumber != st->tabnumber;
+ /* word-wrapping option was toggled */
+ full_update |= drawcache->lheight != st->lheight_dpi;
+ /* word-wrapping option was toggled */
+ full_update |= drawcache->cwidth != st->cwidth;
+ /* text datablock was changed */
+ full_update |= !STREQLEN(drawcache->text_id, txt->id.name, MAX_ID_NAME);
if (st->wordwrap) {
/* update line heights */
@@ -815,7 +823,8 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back)
scroll->ymin = pix_top_margin;
scroll->ymax = pix_available;
- /* when re-sizing a view-port with the bar at the bottom to a greater height more blank lines will be added */
+ /* when re-sizing a view-port with the bar at the bottom to a greater height
+ * more blank lines will be added */
if (ltexth + blank_lines < st->top + st->viewlines) {
blank_lines = st->top + st->viewlines - ltexth;
}
diff --git a/source/blender/editors/space_text/text_format.h b/source/blender/editors/space_text/text_format.h
index 5912dc2402c..0259f24e487 100644
--- a/source/blender/editors/space_text/text_format.h
+++ b/source/blender/editors/space_text/text_format.h
@@ -83,16 +83,26 @@ typedef struct TextFormatType {
} TextFormatType;
enum {
- FMT_TYPE_WHITESPACE = '_', /* Whitespace */
- FMT_TYPE_COMMENT = '#', /* Comment text */
- FMT_TYPE_SYMBOL = '!', /* Punctuation and other symbols */
- FMT_TYPE_NUMERAL = 'n', /* Numerals */
- FMT_TYPE_STRING = 'l', /* String letters */
- FMT_TYPE_DIRECTIVE = 'd', /* Decorator / Preprocessor directive */
- FMT_TYPE_SPECIAL = 'v', /* Special variables (class, def) */
- FMT_TYPE_RESERVED = 'r', /* Reserved keywords currently not in use, but still prohibited (OSL -> switch e.g.) */
- FMT_TYPE_KEYWORD = 'b', /* Built-in names (return, for, etc.) */
- FMT_TYPE_DEFAULT = 'q', /* Regular text (identifiers, etc.) */
+ /** Whitespace */
+ FMT_TYPE_WHITESPACE = '_',
+ /** Comment text */
+ FMT_TYPE_COMMENT = '#',
+ /** Punctuation and other symbols */
+ FMT_TYPE_SYMBOL = '!',
+ /** Numerals */
+ FMT_TYPE_NUMERAL = 'n',
+ /** String letters */
+ FMT_TYPE_STRING = 'l',
+ /** Decorator / Preprocessor directive */
+ FMT_TYPE_DIRECTIVE = 'd',
+ /** Special variables (class, def) */
+ FMT_TYPE_SPECIAL = 'v',
+ /** Reserved keywords currently not in use, but still prohibited (OSL -> switch e.g.) */
+ FMT_TYPE_RESERVED = 'r',
+ /** Built-in names (return, for, etc.) */
+ FMT_TYPE_KEYWORD = 'b',
+ /** Regular text (identifiers, etc.) */
+ FMT_TYPE_DEFAULT = 'q',
};
TextFormatType *ED_text_format_get(Text *text);
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c
index fe6c43cb74a..0045eec4f7e 100644
--- a/source/blender/editors/space_text/text_ops.c
+++ b/source/blender/editors/space_text/text_ops.c
@@ -1188,7 +1188,8 @@ static int text_convert_whitespace_exec(bContext *C, wmOperator *op)
if (tmp->format)
MEM_freeN(tmp->format);
- /* Put new_line in the tmp->line spot still need to try and set the curc correctly. */
+ /* Put new_line in the tmp->line spot
+ * still need to try and set the curc correctly. */
tmp->line = BLI_strdup(tmp_line);
tmp->len = strlen(tmp_line);
tmp->format = NULL;
@@ -2144,7 +2145,8 @@ typedef struct TextScroll {
static bool text_scroll_poll(bContext *C)
{
- /* it should be possible to still scroll linked texts to read them, even if they can't be edited... */
+ /* it should be possible to still scroll linked texts to read them,
+ * even if they can't be edited... */
return CTX_data_edit_text(C) != NULL;
}
@@ -2470,7 +2472,8 @@ static TextLine *get_line_pos_wrapped(SpaceText *st, ARegion *ar, int *y)
lines = text_get_visible_lines(st, ar, linep->line);
if (i + lines > *y) {
- /* We found the line matching given vertical 'coordinate', now set y relative to this line's start. */
+ /* We found the line matching given vertical 'coordinate',
+ * now set y relative to this line's start. */
*y -= i;
break;
}
@@ -2530,7 +2533,8 @@ static void text_cursor_set_to_pos_wrapped(SpaceText *st, ARegion *ar, int x, in
end = MIN2(end, i);
if (found) {
- /* exact cursor position was found, check if it's still on needed line (hasn't been wrapped) */
+ /* exact cursor position was found, check if it's still on needed line
+ * (hasn't been wrapped) */
if (charp > endj && !chop && ch != '\0')
charp = endj;
break;
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
index 497cca22ba6..b7f6b045d4b 100644
--- a/source/blender/editors/space_userpref/space_userpref.c
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -121,7 +121,8 @@ static SpaceLink *userpref_duplicate(SpaceLink *sl)
/* add handlers, stuff you only do once or on area/region changes */
static void userpref_main_region_init(wmWindowManager *wm, ARegion *ar)
{
- /* do not use here, the properties changed in userprefs do a system-wide refresh, then scroller jumps back */
+ /* do not use here, the properties changed in userprefs do a system-wide refresh,
+ * then scroller jumps back */
/* ar->v2d.flag &= ~V2D_IS_INITIALISED; */
ar->v2d.scroll = V2D_SCROLL_RIGHT | V2D_SCROLL_VERTICAL_HIDE;
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c
index ea19c734940..e0e8ae0c04e 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -80,7 +80,7 @@ static bool check_ob_drawface_dot(Scene *sce, View3D *vd, char dt)
return true;
}
-/* ----------------- OpenGL Circle Drawing - Tables for Optimized Drawing Speed ------------------ */
+/* OpenGL Circle Drawing - Tables for Optimized Drawing Speed */
/* 32 values of sin function (still same result!) */
#define CIRCLE_RESOL 32
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 79e5026c7c5..7b3d1ac6072 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -568,7 +568,8 @@ static bool view3d_mat_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEven
static bool view3d_ima_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event), const char **UNUSED(tooltip))
{
if (drag->type == WM_DRAG_PATH) {
- return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE)); /* rule might not work? */
+ /* rule might not work? */
+ return (ELEM(drag->icon, 0, ICON_FILE_IMAGE, ICON_FILE_MOVIE));
}
else {
return WM_drag_ID(drag, ID_IM) != NULL;
@@ -1368,7 +1369,8 @@ const char *view3d_context_dir[] = {
static int view3d_context(const bContext *C, const char *member, bContextDataResult *result)
{
- /* fallback to the scene layer, allows duplicate and other object operators to run outside the 3d view */
+ /* fallback to the scene layer,
+ * allows duplicate and other object operators to run outside the 3d view */
if (CTX_data_dir(member)) {
CTX_data_dir_set(result, view3d_context_dir);
@@ -1436,7 +1438,8 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i
if (is_local == false) {
if ((ID *)v3d->ob_centre == old_id) {
v3d->ob_centre = (Object *)new_id;
- /* Otherwise, bonename may remain valid... We could be smart and check this, too? */
+ /* Otherwise, bonename may remain valid...
+ * We could be smart and check this, too? */
if (new_id == NULL) {
v3d->ob_centre_bone[0] = '\0';
}
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 87bbb347bd0..e13e28c892c 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -708,7 +708,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
apply_raw_diff(&bezt->alfa, tot, ve_median->tilt, median->tilt);
}
}
- else if (apply_vcos) { /* Handles can only have their coordinates changed here. */
+ else if (apply_vcos) {
+ /* Handles can only have their coordinates changed here. */
if (bezt->f1 & SELECT) {
apply_raw_diff_v3(bezt->vec[0], tot, ve_median->location, median->location);
}
@@ -1232,7 +1233,7 @@ void view3d_buttons_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
strcpy(pt->idname, "VIEW3D_PT_transform");
- strcpy(pt->label, N_("Transform")); /* XXX C panels not available through RNA (bpy.types)! */
+ strcpy(pt->label, N_("Transform")); /* XXX C panels unavailable through RNA bpy.types! */
strcpy(pt->category, "View");
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
pt->draw = view3d_panel_transform;
@@ -1241,7 +1242,7 @@ void view3d_buttons_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
strcpy(pt->idname, "VIEW3D_PT_vgroup");
- strcpy(pt->label, N_("Vertex Weights")); /* XXX C panels are not available through RNA (bpy.types)! */
+ strcpy(pt->label, N_("Vertex Weights")); /* XXX C panels unavailable through RNA bpy.types! */
strcpy(pt->category, "View");
strcpy(pt->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
pt->draw = view3d_panel_vgroup;
diff --git a/source/blender/editors/space_view3d/view3d_camera_control.c b/source/blender/editors/space_view3d/view3d_camera_control.c
index d2239b9b8ba..dc9144a4f5a 100644
--- a/source/blender/editors/space_view3d/view3d_camera_control.c
+++ b/source/blender/editors/space_view3d/view3d_camera_control.c
@@ -223,7 +223,8 @@ void ED_view3d_cameracontrol_update(
const bool use_autokey,
struct bContext *C, const bool do_rotate, const bool do_translate)
{
- /* we are in camera view so apply the view ofs and quat to the view matrix and set the camera to the view */
+ /* we are in camera view so apply the view ofs and quat to the view matrix and set the camera
+ * to the view */
Scene *scene = vctrl->ctx_scene;
View3D *v3d = vctrl->ctx_v3d;
@@ -309,7 +310,8 @@ void ED_view3d_cameracontrol_release(
DEG_id_tag_update(&ob_back->id, ID_RECALC_TRANSFORM);
}
else {
- /* Non Camera we need to reset the view back to the original location because the user canceled*/
+ /* Non Camera we need to reset the view back
+ * to the original location because the user canceled. */
copy_qt_qt(rv3d->viewquat, vctrl->rot_backup);
rv3d->persp = vctrl->persp_backup;
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 92fb64964aa..9d6eb6f76e7 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -718,7 +718,10 @@ void ED_view3d_draw_depth(
/* temp set drawtype to solid */
/* Setting these temporarily is not nice */
v3d->flag &= ~V3D_SELECT_OUTLINE;
- U.glalphaclip = alphaoverride ? 0.5f : glalphaclip; /* not that nice but means we wont zoom into billboards */
+
+ /* not that nice but means we wont zoom into billboards */
+ U.glalphaclip = alphaoverride ? 0.5f : glalphaclip;
+
U.obcenter_dia = 0;
/* Tools may request depth outside of regular drawing code. */
@@ -814,7 +817,8 @@ float ED_view3d_grid_view_scale(
static void draw_view_axis(RegionView3D *rv3d, const rcti *rect)
{
const float k = U.rvisize * U.pixelsize; /* axis size */
- const int bright = - 20 * (10 - U.rvibright); /* axis alpha offset (rvibright has range 0-10) */
+ /* axis alpha offset (rvibright has range 0-10) */
+ const int bright = - 20 * (10 - U.rvibright);
/* Axis center in screen coordinates.
*
@@ -1211,12 +1215,15 @@ static void draw_selected_name(Scene *scene, ViewLayer *view_layer, Object *ob,
}
/* color depends on whether there is a keyframe */
- if (id_frame_has_keyframe((ID *)ob, /* BKE_scene_frame_get(scene) */ (float)cfra, ANIMFILTER_KEYS_LOCAL))
+ if (id_frame_has_keyframe((ID *)ob, /* BKE_scene_frame_get(scene) */ (float)cfra, ANIMFILTER_KEYS_LOCAL)) {
UI_FontThemeColor(font_id, TH_TIME_KEYFRAME);
- else if (ED_gpencil_has_keyframe_v3d(scene, ob, cfra))
+ }
+ else if (ED_gpencil_has_keyframe_v3d(scene, ob, cfra)) {
UI_FontThemeColor(font_id, TH_TIME_GP_KEYFRAME);
- else
+ }
+ else {
UI_FontThemeColor(font_id, TH_TEXT_HI);
+ }
}
else {
/* no object */
diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c
index 04e19efdb20..734e4471a19 100644
--- a/source/blender/editors/space_view3d/view3d_draw_legacy.c
+++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c
@@ -563,7 +563,8 @@ static void view3d_draw_bgpic(Scene *scene, Depsgraph *depsgraph,
if (ibuf == NULL)
continue;
- if ((ibuf->rect == NULL && ibuf->rect_float == NULL) || ibuf->channels != 4) { /* invalid image format */
+ if ((ibuf->rect == NULL && ibuf->rect_float == NULL) || ibuf->channels != 4) {
+ /* invalid image format */
if (freeibuf)
IMB_freeImBuf(freeibuf);
if (releaseibuf)
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 070e02074ff..7a368d2ca02 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -457,8 +457,8 @@ static void viewops_data_create(
negate_v3_v3(my_origin, rv3d->ofs); /* ofs is flipped */
- /* Set the dist value to be the distance from this 3d point
- * this means youll always be able to zoom into it and panning wont go bad when dist was zero */
+ /* Set the dist value to be the distance from this 3d point this means youll
+ * always be able to zoom into it and panning wont go bad when dist was zero */
/* remove dist value */
upvec[0] = upvec[1] = 0;
@@ -469,7 +469,8 @@ static void viewops_data_create(
sub_v3_v3v3(my_pivot, rv3d->ofs, upvec);
negate_v3(my_pivot); /* ofs is flipped */
- /* find a new ofs value that is along the view axis (rather than the mouse location) */
+ /* find a new ofs value that is along the view axis
+ * (rather than the mouse location) */
closest_to_line_v3(dvec, vod->dyn_ofs, my_pivot, my_origin);
vod->init.dist = rv3d->dist = len_v3v3(my_pivot, dvec);
@@ -1224,7 +1225,8 @@ void view3d_ndof_fly(
}
if (!is_zero_v3(trans)) {
- /* move center of view opposite of hand motion (this is camera mode, not object mode) */
+ /* move center of view opposite of hand motion
+ * (this is camera mode, not object mode) */
sub_v3_v3(rv3d->ofs, trans);
has_translate = true;
}
@@ -2819,7 +2821,8 @@ static int viewselected_exec(bContext *C, wmOperator *op)
if (ob_eval && (ob_eval->mode & OB_MODE_WEIGHT_PAINT)) {
/* hard-coded exception, we look for the one selected armature */
- /* this is weak code this way, we should make a generic active/selection callback interface once... */
+ /* this is weak code this way, we should make a generic
+ * active/selection callback interface once... */
Base *base_eval;
for (base_eval = view_layer_eval->object_bases.first; base_eval; base_eval = base_eval->next) {
if (BASE_SELECTED_EDITABLE(v3d, base_eval)) {
@@ -2896,8 +2899,10 @@ static int viewselected_exec(bContext *C, wmOperator *op)
}
/* account for duplis */
- if (BKE_object_minmax_dupli(depsgraph, scene, base_eval->object, min, max, false) == 0)
- BKE_object_minmax(base_eval->object, min, max, false); /* use if duplis not found */
+ if (BKE_object_minmax_dupli(depsgraph, scene, base_eval->object, min, max, false) == 0) {
+ /* use if duplis not found */
+ BKE_object_minmax(base_eval->object, min, max, false);
+ }
ok = 1;
}
@@ -3136,7 +3141,7 @@ void VIEW3D_OT_view_center_pick(wmOperatorType *ot)
/** \name View Camera Center Operator
* \{ */
-static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */
+static int view3d_center_camera_exec(bContext *C, wmOperator *UNUSED(op))
{
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Scene *scene = CTX_data_scene(C);
@@ -3188,7 +3193,7 @@ void VIEW3D_OT_view_center_camera(wmOperatorType *ot)
/** \name View Lock Center Operator
* \{ */
-static int view3d_center_lock_exec(bContext *C, wmOperator *UNUSED(op)) /* was view3d_home() in 2.4x */
+static int view3d_center_lock_exec(bContext *C, wmOperator *UNUSED(op))
{
RegionView3D *rv3d = CTX_wm_region_view3d(C);
@@ -4560,7 +4565,8 @@ void ED_view3d_clipping_local(RegionView3D *rv3d, float mat[4][4])
calc_local_clipping(rv3d->clip_local, rv3d->clipbb, mat);
}
-#if 0 /* TODO Missing from 2.8 drawing code. Find a solution to support clip border then uncomment it. */
+#if 0 /* TODO Missing from 2.8 drawing code.
+ * Find a solution to support clip border then uncomment it. */
static int view3d_clipping_exec(bContext *C, wmOperator *op)
{
@@ -4788,7 +4794,8 @@ void ED_view3d_cursor3d_update(
}
}
else {
- /* Cursor may be outside of the view, prevent it getting 'lost', see: T40353 & T45301 */
+ /* Cursor may be outside of the view,
+ * prevent it getting 'lost', see: T40353 & T45301 */
zero_v2(rv3d->ofs_lock);
}
}
diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c
index b27de9d70c2..69f32c8eada 100644
--- a/source/blender/editors/space_view3d/view3d_fly.c
+++ b/source/blender/editors/space_view3d/view3d_fly.c
@@ -92,11 +92,12 @@ typedef enum eFlyPanState {
/* disabled */
FLY_AXISLOCK_STATE_OFF = 0,
- /* enabled but not checking because mouse hasn't moved outside the margin since locking was checked an not needed
- * when the mouse moves, locking is set to 2 so checks are done. */
+ /* enabled but not checking because mouse hasn't moved outside the margin since locking was
+ * checked an not needed when the mouse moves, locking is set to 2 so checks are done. */
FLY_AXISLOCK_STATE_IDLE = 1,
- /* mouse moved and checking needed, if no view altering is done its changed back to #FLY_AXISLOCK_STATE_IDLE */
+ /* mouse moved and checking needed,
+ * if no view altering is done its changed back to #FLY_AXISLOCK_STATE_IDLE */
FLY_AXISLOCK_STATE_ACTIVE = 2
} eFlyPanState;
@@ -533,7 +534,8 @@ static void flyEvent(bContext *C, wmOperator *op, FlyInfo *fly, const wmEvent *e
time_wheel = (float)(time_currwheel - fly->time_lastwheel);
fly->time_lastwheel = time_currwheel;
/* Mouse wheel delays range from (0.5 == slow) to (0.01 == fast) */
- time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
+ /* 0-0.5 -> 0-5.0 */
+ time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f)));
if (fly->speed < 0.0f) {
fly->speed = 0.0f;
@@ -557,7 +559,8 @@ static void flyEvent(bContext *C, wmOperator *op, FlyInfo *fly, const wmEvent *e
time_currwheel = PIL_check_seconds_timer();
time_wheel = (float)(time_currwheel - fly->time_lastwheel);
fly->time_lastwheel = time_currwheel;
- time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f))); /* 0-0.5 -> 0-5.0 */
+ /* 0-0.5 -> 0-5.0 */
+ time_wheel = 1.0f + (10.0f - (20.0f * min_ff(time_wheel, 0.5f)));
if (fly->speed > 0.0f) {
fly->speed = 0;
@@ -577,7 +580,8 @@ static void flyEvent(bContext *C, wmOperator *op, FlyInfo *fly, const wmEvent *e
/* implement WASD keys,
* comments only for 'forward '*/
case FLY_MODAL_DIR_FORWARD:
- if (fly->axis == 2 && fly->speed < 0.0f) { /* reverse direction stops, tap again to continue */
+ if (fly->axis == 2 && fly->speed < 0.0f) {
+ /* reverse direction stops, tap again to continue */
fly->axis = -1;
}
else {
@@ -696,14 +700,17 @@ static int flyApply(bContext *C, FlyInfo *fly)
*/
RegionView3D *rv3d = fly->rv3d;
- float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */
- float dvec[3] = {0, 0, 0}; /* this is the direction that's added to the view offset per redraw */
+ /* 3x3 copy of the view matrix so we can move along the view axis */
+ float mat[3][3];
+ /* this is the direction that's added to the view offset per redraw */
+ float dvec[3] = {0, 0, 0};
/* Camera Uprighting variables */
float moffset[2]; /* mouse offset from the views center */
float tmp_quat[4]; /* used for rotating the view */
- int xmargin, ymargin; /* x and y margin are define the safe area where the mouses movement wont rotate the view */
+ /* x and y margin are define the safe area where the mouses movement wont rotate the view */
+ int xmargin, ymargin;
#ifdef NDOF_FLY_DEBUG
{
@@ -765,7 +772,10 @@ static int flyApply(bContext *C, FlyInfo *fly)
#endif
time_current = PIL_check_seconds_timer();
time_redraw = (float)(time_current - fly->time_lastdraw);
- time_redraw_clamped = min_ff(0.05f, time_redraw); /* clamp redraw time to avoid jitter in roll correction */
+
+ /* clamp redraw time to avoid jitter in roll correction */
+ time_redraw_clamped = min_ff(0.05f, time_redraw);
+
fly->time_lastdraw = time_current;
/* Scale the time to use shift to scale the speed down- just like
@@ -855,7 +865,8 @@ static int flyApply(bContext *C, FlyInfo *fly)
fly->zlock_momentum += FLY_ZUP_CORRECT_ACCEL;
}
else {
- fly->zlock = FLY_AXISLOCK_STATE_IDLE; /* don't check until the view rotates again */
+ /* don't check until the view rotates again */
+ fly->zlock = FLY_AXISLOCK_STATE_IDLE;
fly->zlock_momentum = 0.0f;
}
}
diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
index f57ff4464e0..d71cd68c2c0 100644
--- a/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
+++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
@@ -485,7 +485,8 @@ static int gizmo_axis_test_select(
bool ok = true;
- /* Check if we're viewing on an axis, there is no point to clicking on the current axis so show the reverse. */
+ /* Check if we're viewing on an axis,
+ * there is no point to clicking on the current axis so show the reverse. */
if (len_squared_v2(co) < 1e-6f && (gz->matrix_offset[i][2] > 0.0f) == is_pos) {
ok = false;
}
diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c
index 718f3cd40f1..e8e3d620d48 100644
--- a/source/blender/editors/space_view3d/view3d_project.c
+++ b/source/blender/editors/space_view3d/view3d_project.c
@@ -116,9 +116,10 @@ eV3DProjStatus ED_view3d_project_base(const struct ARegion *ar, struct Base *bas
* - 'rv3d->perspmat', is_local == false
* - 'rv3d->persmatob', is_local == true
*/
-static eV3DProjStatus ed_view3d_project__internal(const ARegion *ar,
- float perspmat[4][4], const bool is_local, /* normally hidden */
- const float co[3], float r_co[2], const eV3DProjTest flag)
+static eV3DProjStatus ed_view3d_project__internal(
+ const ARegion *ar,
+ float perspmat[4][4], const bool is_local, /* normally hidden */
+ const float co[3], float r_co[2], const eV3DProjTest flag)
{
float vec4[4];
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index c976803065e..e10075cabb5 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -169,7 +169,8 @@ static void object_deselect_all_visible(ViewLayer *view_layer, View3D *v3d)
}
}
-static void object_deselect_all_except(ViewLayer *view_layer, Base *b) /* deselect all except b */
+/* deselect all except b */
+static void object_deselect_all_except(ViewLayer *view_layer, Base *b)
{
for (Base *base = view_layer->object_bases.first; base; base = base->next) {
if (base->flag & BASE_SELECTED) {
@@ -941,7 +942,8 @@ static void do_lasso_select_paintface(ViewContext *vc, const int mcords[][2], sh
return;
if (SEL_OP_USE_PRE_DESELECT(sel_op)) {
- paintface_deselect_all_visible(vc->C, ob, SEL_DESELECT, false); /* flush selection at the end */
+ /* flush selection at the end */
+ paintface_deselect_all_visible(vc->C, ob, SEL_DESELECT, false);
}
bm_vertoffs = me->totpoly + 1; /* max index array */
@@ -1155,7 +1157,8 @@ static int object_select_menu_exec(bContext *C, wmOperator *op)
CTX_DATA_BEGIN (C, Base *, base, selectable_bases)
{
- /* this is a bit dodjy, there should only be ONE object with this name, but library objects can mess this up */
+ /* this is a bit dodjy, there should only be ONE object with this name,
+ * but library objects can mess this up */
if (STREQ(name, base->object->id.name + 2)) {
ED_object_base_activate(C, base);
ED_object_base_select(base, BA_SELECT);
@@ -1610,7 +1613,9 @@ static bool ed_object_select_pick(
startbase = FIRSTBASE(view_layer);
if (BASACT(view_layer) && BASACT(view_layer)->next) startbase = BASACT(view_layer)->next;
- /* This block uses the control key to make the object selected by its center point rather than its contents */
+ /* This block uses the control key to make the object selected
+ * by its center point rather than its contents */
+
/* in editmode do not activate */
if (obcenter) {
@@ -1699,7 +1704,8 @@ static bool ed_object_select_pick(
}
/* index of bundle is 1<<16-based. if there's no "bone" index
- * in height word, this buffer value belongs to camera. not to bundle */
+ * in height word, this buffer value belongs to camera. not to bundle
+ */
if (buffer[4 * i + 3] & 0xFFFF0000) {
MovieClip *clip = BKE_object_movieclip_get(scene, basact->object, false);
MovieTracking *tracking = &clip->tracking;
@@ -1758,7 +1764,8 @@ static bool ed_object_select_pick(
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, basact->object);
WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object);
- /* in weightpaint, we use selected bone to select vertexgroup, so no switch to new active object */
+ /* in weightpaint, we use selected bone to select vertexgroup,
+ * so no switch to new active object */
if (BASACT(view_layer) && (BASACT(view_layer)->object->mode & OB_MODE_WEIGHT_PAINT)) {
/* prevent activating */
basact = NULL;
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 9729598b022..636d46aa5d0 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -551,7 +551,10 @@ void VIEW3D_OT_snap_cursor_to_grid(wmOperatorType *ot)
/* **************************************************** */
-/** Returns the center position of a tracking marker visible on the viewport (useful to snap to). **/
+/**
+ * Returns the center position of a tracking marker visible on the viewport
+ * (useful to snap to).
+ */
static void bundle_midpoint(Scene *scene, Object *ob, float r_vec[3])
{
MovieClip *clip = BKE_object_movieclip_get(scene, ob, false);
@@ -830,7 +833,10 @@ void VIEW3D_OT_snap_cursor_to_center(wmOperatorType *ot)
/* **************************************************** */
-/** Calculates the bounding box corners (min and max) for \a obedit. The returned values are in global space. **/
+/**
+ * Calculates the bounding box corners (min and max) for \a obedit.
+ * The returned values are in global space.
+ */
bool ED_view3d_minmax_verts(Object *obedit, float r_min[3], float r_max[3])
{
TransVertStore tvs = {NULL};
diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c
index 96f18ade149..57a8f2e46d7 100644
--- a/source/blender/editors/space_view3d/view3d_utils.c
+++ b/source/blender/editors/space_view3d/view3d_utils.c
@@ -106,7 +106,8 @@ void ED_view3d_cursor3d_calc_mat4(const Scene *scene, float mat[4][4])
Camera *ED_view3d_camera_data_get(View3D *v3d, RegionView3D *rv3d)
{
- /* establish the camera object, so we can default to view mapping if anything is wrong with it */
+ /* establish the camera object,
+ * so we can default to view mapping if anything is wrong with it */
if ((rv3d->persp == RV3D_CAMOB) && v3d->camera && (v3d->camera->type == OB_CAMERA)) {
return v3d->camera->data;
}
@@ -438,7 +439,8 @@ bool ED_view3d_persp_ensure(const Depsgraph *depsgraph, View3D *v3d, ARegion *ar
if (rv3d->persp != RV3D_PERSP) {
if (rv3d->persp == RV3D_CAMOB) {
- /* If autopersp and previous view was an axis one, switch back to PERSP mode, else reuse previous mode. */
+ /* If autopersp and previous view was an axis one,
+ * switch back to PERSP mode, else reuse previous mode. */
char persp = (autopersp && RV3D_VIEW_IS_AXIS(rv3d->lview)) ? RV3D_PERSP : rv3d->lpersp;
ED_view3d_persp_switch_from_camera(depsgraph, v3d, rv3d, persp);
}
@@ -1114,7 +1116,8 @@ float ED_view3d_radius_to_dist(
angle = focallength_to_fov(lens, sensor_size);
- /* zoom influences lens, correct this by scaling the angle as a distance (by the zoom-level) */
+ /* zoom influences lens, correct this by scaling the angle as a distance
+ * (by the zoom-level) */
angle = atanf(tanf(angle / 2.0f) * zoom) * 2.0f;
dist = ED_view3d_radius_to_dist_persp(angle, radius);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index 48caace5fd3..6945ba27109 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -212,7 +212,8 @@ void ED_view3d_smooth_view_ex(
}
/* grid draw as floor */
if ((rv3d->viewlock & RV3D_LOCKED) == 0) {
- /* use existing if exists, means multiple calls to smooth view wont loose the original 'view' setting */
+ /* use existing if exists, means multiple calls to smooth view
+ * wont loose the original 'view' setting */
rv3d->view = RV3D_VIEW_USER;
}
@@ -224,7 +225,8 @@ void ED_view3d_smooth_view_ex(
* this means small rotations wont lag */
if (sview->quat && !sview->ofs && !sview->dist) {
/* scale the time allowed by the rotation */
- sms.time_allowed *= (double)fabsf(angle_signed_normalized_qtqt(sms.dst.quat, sms.src.quat)) / M_PI; /* 180deg == 1.0 */
+ /* 180deg == 1.0 */
+ sms.time_allowed *= (double)fabsf(angle_signed_normalized_qtqt(sms.dst.quat, sms.src.quat)) / M_PI;
}
/* ensure it shows correct */
@@ -239,8 +241,8 @@ void ED_view3d_smooth_view_ex(
rv3d->rflag |= RV3D_NAVIGATING;
- /* not essential but in some cases the caller will tag the area for redraw,
- * and in that case we can get a flicker of the 'org' user view but we want to see 'src' */
+ /* not essential but in some cases the caller will tag the area for redraw, and in that
+ * case we can get a flicker of the 'org' user view but we want to see 'src' */
view3d_smooth_view_state_restore(&sms.src, v3d, rv3d);
/* keep track of running timer! */
@@ -252,7 +254,8 @@ void ED_view3d_smooth_view_ex(
WM_event_remove_timer(wm, win, rv3d->smooth_timer);
}
/* TIMER1 is hardcoded in keymap */
- rv3d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0); /* max 30 frs/sec */
+ /* max 30 frs/sec */
+ rv3d->smooth_timer = WM_event_add_timer(wm, win, TIMER1, 1.0 / 100.0);
ok = true;
}
diff --git a/source/blender/editors/space_view3d/view3d_walk.c b/source/blender/editors/space_view3d/view3d_walk.c
index c19a1965a56..973f76a8b53 100644
--- a/source/blender/editors/space_view3d/view3d_walk.c
+++ b/source/blender/editors/space_view3d/view3d_walk.c
@@ -947,8 +947,10 @@ static int walkApply(bContext *C, wmOperator *op, WalkInfo *walk)
RegionView3D *rv3d = walk->rv3d;
ARegion *ar = walk->ar;
- float mat[3][3]; /* 3x3 copy of the view matrix so we can move along the view axis */
- float dvec[3] = {0.0f, 0.0f, 0.0f}; /* this is the direction that's added to the view offset per redraw */
+ /* 3x3 copy of the view matrix so we can move along the view axis */
+ float mat[3][3];
+ /* this is the direction that's added to the view offset per redraw */
+ float dvec[3] = {0.0f, 0.0f, 0.0f};
int moffset[2]; /* mouse offset from the views center */
float tmp_quat[4]; /* used for rotating the view */
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 53943eb830e..10082eaa6ef 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -382,7 +382,8 @@ void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DPr
if (t->spacetype == SPACE_VIEW3D) {
if (t->ar->regiontype == RGN_TYPE_WINDOW) {
if (ED_view3d_project_int_global(t->ar, vec, adr, flag) != V3D_PROJ_RET_OK) {
- adr[0] = (int)2140000000.0f; /* this is what was done in 2.64, perhaps we can be smarter? */
+ /* this is what was done in 2.64, perhaps we can be smarter? */
+ adr[0] = (int)2140000000.0f;
adr[1] = (int)2140000000.0f;
}
}
@@ -1055,7 +1056,8 @@ int transformEvent(TransInfo *t, const wmEvent *event)
copy_v2_v2_int(t->mval, event->mval);
- // t->redraw |= TREDRAW_SOFT; /* Use this for soft redraw. Might cause flicker in object mode */
+ /* Use this for soft redraw. Might cause flicker in object mode */
+ // t->redraw |= TREDRAW_SOFT;
t->redraw |= TREDRAW_HARD;
if (t->state == TRANS_STARTING) {
@@ -1381,7 +1383,8 @@ int transformEvent(TransInfo *t, const wmEvent *event)
}
else {
if (event->shift) {
- /* bit hackish... but it prevents mmb select to print the orientation from menu */
+ /* bit hackish... but it prevents mmb select to print the
+ * orientation from menu */
float mati[3][3];
strcpy(t->spacename, "global");
unit_m3(mati);
@@ -1985,7 +1988,8 @@ static void drawTransformView(const struct bContext *C, ARegion *ar, void *arg)
}
}
-/* just draw a little warning message in the top-right corner of the viewport to warn that autokeying is enabled */
+/* just draw a little warning message in the top-right corner of the viewport
+ * to warn that autokeying is enabled */
static void drawAutoKeyWarning(TransInfo *UNUSED(t), ARegion *ar)
{
rcti rect;
@@ -2183,7 +2187,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op)
const int orientation_index_custom = BKE_scene_transform_orientation_get_index(
t->scene, t->orientation.custom);
- /* Maybe we need a t->con.custom_orientation? Seems like it would always match t->orientation.custom. */
+ /* Maybe we need a t->con.custom_orientation?
+ * Seems like it would always match t->orientation.custom. */
orientation = V3D_MANIP_CUSTOM + orientation_index_custom;
BLI_assert(orientation >= V3D_MANIP_CUSTOM);
}
@@ -2378,9 +2383,13 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
initSnapSpatial(t, t->snap_spatial);
- /* EVIL! posemode code can switch translation to rotate when 1 bone is selected. will be removed (ton) */
+ /* EVIL! posemode code can switch translation to rotate when 1 bone is selected.
+ * will be removed (ton) */
+
/* EVIL2: we gave as argument also texture space context bit... was cleared */
- /* EVIL3: extend mode for animation editors also switches modes... but is best way to avoid duplicate code */
+
+ /* EVIL3: extend mode for animation editors also switches modes...
+ * but is best way to avoid duplicate code */
mode = t->mode;
calculatePropRatio(t);
@@ -2615,8 +2624,10 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
BMEditMesh *em = NULL;// BKE_editmesh_from_object(t->obedit);
bool do_skip = false;
- /* Currently only used for two of three most frequent transform ops, can include more ops.
- * Note that scaling cannot be included here, non-uniform scaling will affect normals. */
+ /* Currently only used for two of three most frequent transform ops,
+ * can include more ops.
+ * Note that scaling cannot be included here,
+ * non-uniform scaling will affect normals. */
if (ELEM(t->mode, TFM_TRANSLATION, TFM_ROTATION)) {
if (em->bm->totvertsel == em->bm->totvert) {
/* No need to invalidate if whole mesh is selected. */
@@ -4301,7 +4312,7 @@ static void ElementRotation_ex(TransInfo *t, TransDataContainer *tc, TransData *
mul_m3_m3m3(smat, td->smtx, totmat);
/* calculate the total rotatation in eulers */
- add_v3_v3v3(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */
+ add_v3_v3v3(eul, td->ext->irot, td->ext->drot); /* correct for delta rot */
eulO_to_mat3(obmat, eul, td->ext->rotOrder);
/* mat = transform, obmat = object rotation */
mul_m3_m3m3(fmat, smat, obmat);
@@ -4543,7 +4554,8 @@ void freeCustomNormalArray(TransInfo *t, TransDataContainer *tc, TransCustomData
BMEditMesh *em = BKE_editmesh_from_object(tc->obedit);
BMesh *bm = em->bm;
- for (int i = 0; i < lnors_ed_arr->totloop; i++, lnor_ed++) { /* Restore custom loop normal on cancel */
+ /* Restore custom loop normal on cancel */
+ for (int i = 0; i < lnors_ed_arr->totloop; i++, lnor_ed++) {
BKE_lnor_space_custom_normal_to_data(
bm->lnor_spacearr->lspacearr[lnor_ed->loop_index], lnor_ed->niloc, lnor_ed->clnors_data);
}
@@ -6107,9 +6119,12 @@ static void slide_origdata_interp_data_vert(
bool co_next_ok;
- /* In the unlikely case that we're next to a zero length edge - walk around the to the next.
+ /* In the unlikely case that we're next to a zero length edge -
+ * walk around the to the next.
+ *
* Since we only need to check if the vertex is in this corner,
- * its not important _which_ loop - as long as its not overlapping 'sv->co_orig_3d', see: T45096. */
+ * its not important _which_ loop - as long as its not overlapping
+ * 'sv->co_orig_3d', see: T45096. */
project_plane_normalized_v3_v3v3(v_proj[0], co_prev, v_proj_axis);
while (UNLIKELY(((co_prev_ok = (len_squared_v3v3(v_proj[1], v_proj[0]) > eps)) == false) &&
((l_prev = l_prev->prev) != l->next)))
@@ -6947,7 +6962,9 @@ static bool createEdgeSlideVerts_double_side(TransInfo *t, TransDataContainer *t
else if (l_b == NULL && l_a && (l_a->radial_next != l_a)) l_b = l_a->radial_next;
}
else if (e->l != NULL) {
- /* if there are non-contiguous faces, we can still recover the loops of the new edges faces */
+ /* if there are non-contiguous faces, we can still recover
+ * the loops of the new edges faces */
+
/* note!, the behavior in this case means edges may move in opposite directions,
* this could be made to work more usefully. */
@@ -8547,7 +8564,8 @@ static void initSeqSlide(TransInfo *t)
copy_v3_fl(t->num.val_inc, t->snap[1]);
t->num.unit_sys = t->scene->unit.system;
- /* Would be nice to have a time handling in units as well (supporting frames in addition to "natural" time...). */
+ /* Would be nice to have a time handling in units as well
+ * (supporting frames in addition to "natural" time...). */
t->num.unit_type[0] = B_UNIT_NONE;
t->num.unit_type[1] = B_UNIT_NONE;
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index 869cccd0c94..ce41aa85da1 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -997,14 +997,16 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
data = con->data;
if (data->tar == NULL || (data->tar->type == OB_ARMATURE && data->subtarget[0] == '\0')) {
- /* make reference to constraint to base things off later (if it's the last targetless constraint encountered) */
+ /* make reference to constraint to base things off later
+ * (if it's the last targetless constraint encountered) */
targetless = (bKinematicConstraint *)con->data;
/* but, if this is a targetless IK, we make it auto anyway (for the children loop) */
if (con->enforce != 0.0f) {
data->flag |= CONSTRAINT_IK_AUTO;
- /* if no chain length has been specified, just make things obey standard rotation locks too */
+ /* if no chain length has been specified,
+ * just make things obey standard rotation locks too */
if (data->rootbone == 0) {
for (; pchan; pchan = pchan->parent) {
/* here, we set ik-settings for bone from pchan->protectflag */
@@ -1025,7 +1027,10 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
}
con = BKE_constraint_add_for_pose(NULL, pchan, "TempConstraint", CONSTRAINT_TYPE_KINEMATIC);
- pchan->constflag |= (PCHAN_HAS_IK | PCHAN_HAS_TARGET); /* for draw, but also for detecting while pose solving */
+
+ /* for draw, but also for detecting while pose solving */
+ pchan->constflag |= (PCHAN_HAS_IK | PCHAN_HAS_TARGET);
+
data = con->data;
if (targetless) {
/* if exists, use values from last targetless (but disabled) IK-constraint as base */
@@ -1035,7 +1040,10 @@ static short pose_grab_with_ik_add(bPoseChannel *pchan)
data->flag = CONSTRAINT_IK_TIP;
data->flag |= CONSTRAINT_IK_TEMP | CONSTRAINT_IK_AUTO | CONSTRAINT_IK_POS;
copy_v3_v3(data->grabtarget, pchan->pose_tail);
- data->rootbone = 0; /* watch-it! has to be 0 here, since we're still on the same bone for the first time through the loop [#25885] */
+
+ /* watch-it! has to be 0 here, since we're still on the
+ * same bone for the first time through the loop T25885. */
+ data->rootbone = 0;
/* we only include bones that are part of a continual connected chain */
do {
@@ -1096,7 +1104,8 @@ static short pose_grab_with_ik(Main *bmain, Object *ob)
arm = ob->data;
- /* Rule: allow multiple Bones (but they must be selected, and only one ik-solver per chain should get added) */
+ /* Rule: allow multiple Bones
+ * (but they must be selected, and only one ik-solver per chain should get added) */
for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) {
if (pchan->bone->layer & arm->layer) {
if (pchan->bone->flag & BONE_SELECTED) {
@@ -1856,7 +1865,8 @@ static void createTransCurveVerts(TransInfo *t)
else td->flag = 0;
td->ext = NULL;
- if (t->mode == TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/ /* TODO - make points scale */
+ /* TODO - make points scale */
+ if (t->mode == TFM_CURVE_SHRINKFATTEN) { /* || t->mode==TFM_RESIZE) {*/
td->val = &(bezt->radius);
td->ival = bezt->radius;
}
@@ -1876,7 +1886,8 @@ static void createTransCurveVerts(TransInfo *t)
if ((bezt_tx & SEL_F1) == 0 && (bezt_tx & SEL_F3) == 0)
/* If the middle is selected but the sides arnt, this is needed */
- if (hdata == NULL) { /* if the handle was not saved by the previous handle */
+ if (hdata == NULL) {
+ /* if the handle was not saved by the previous handle */
hdata = initTransDataCurveHandles(td, bezt);
}
@@ -1900,7 +1911,8 @@ static void createTransCurveVerts(TransInfo *t)
td->ext = NULL;
td->val = NULL;
- if (hdata == NULL) { /* if the handle was not saved by the previous handle */
+ if (hdata == NULL) {
+ /* if the handle was not saved by the previous handle */
hdata = initTransDataCurveHandles(td, bezt);
}
@@ -1927,7 +1939,8 @@ static void createTransCurveVerts(TransInfo *t)
/* TODO - in the case of tilt and radius we can also avoid allocating the initTransDataCurveHandles
* but for now just don't change handle types */
if (ELEM(t->mode, TFM_CURVE_SHRINKFATTEN, TFM_TILT, TFM_DUMMY) == 0) {
- /* sets the handles based on their selection, do this after the data is copied to the TransData */
+ /* sets the handles based on their selection,
+ * do this after the data is copied to the TransData */
BKE_nurb_handles_test(nu, !hide_handles);
}
}
@@ -2455,7 +2468,8 @@ static struct TransIslandData *editmesh_islands_info_calc(
vert_map = MEM_mallocN(sizeof(*vert_map) * bm->totvert, __func__);
/* we shouldn't need this, but with incorrect selection flushing
- * its possible we have a selected vertex that's not in a face, for now best not crash in that case. */
+ * its possible we have a selected vertex that's not in a face,
+ * for now best not crash in that case. */
copy_vn_i(vert_map, bm->totvert, -1);
BM_mesh_elem_table_ensure(bm, htype);
@@ -2667,10 +2681,12 @@ static void createTransEditVerts(TransInfo *t)
int island_info_tot;
int *island_vert_map = NULL;
- /* Snap rotation along normal needs a common axis for whole islands, otherwise one get random crazy results,
- * see T59104. However, we do not want to use the island center for the pivot/translation reference... */
+ /* Snap rotation along normal needs a common axis for whole islands,
+ * otherwise one get random crazy results, see T59104.
+ * However, we do not want to use the island center for the pivot/translation reference. */
const bool is_snap_rotate = ((t->mode == TFM_TRANSLATION) &&
- /* There is not guarantee that snapping is initialized yet at this point... */
+ /* There is not guarantee that snapping
+ * is initialized yet at this point... */
(usingSnappingNormal(t) || (t->settings->snap_flag & SCE_SNAP_ROTATE) != 0) &&
(t->around != V3D_AROUND_LOCAL_ORIGINS));
/* Even for translation this is needed because of island-orientation, see: T51651. */
@@ -2969,7 +2985,8 @@ BLI_INLINE void trans_update_seq(Scene *sce, Sequence *seq, int old_start, int s
void flushTransSeq(TransInfo *t)
{
- ListBase *seqbasep = BKE_sequencer_editing_get(t->scene, false)->seqbasep; /* Editing null check already done */
+ /* Editing null check already done */
+ ListBase *seqbasep = BKE_sequencer_editing_get(t->scene, false)->seqbasep;
int a, new_frame;
TransData *td = NULL;
@@ -2996,11 +3013,15 @@ void flushTransSeq(TransInfo *t)
switch (tdsq->sel_flag) {
case SELECT:
#ifdef SEQ_TX_NESTED_METAS
- if ((seq->depth != 0 || BKE_sequence_tx_test(seq))) /* for meta's, their children move */
+ if ((seq->depth != 0 || BKE_sequence_tx_test(seq))) {
+ /* for meta's, their children move */
seq->start = new_frame - tdsq->start_offset;
+ }
#else
- if (seq->type != SEQ_TYPE_META && (seq->depth != 0 || seq_tx_test(seq))) /* for meta's, their children move */
+ if (seq->type != SEQ_TYPE_META && (seq->depth != 0 || seq_tx_test(seq))) {
+ /* for meta's, their children move */
seq->start = new_frame - tdsq->start_offset;
+ }
#endif
if (seq->depth == 0) {
seq->machine = round_fl_to_int(td2d->loc[1]);
@@ -3010,12 +3031,16 @@ void flushTransSeq(TransInfo *t)
case SEQ_LEFTSEL: /* no vertical transform */
BKE_sequence_tx_set_final_left(seq, new_frame);
BKE_sequence_tx_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL);
- BKE_sequence_single_fix(seq); /* todo - move this into aftertrans update? - old seq tx needed it anyway */
+
+ /* todo - move this into aftertrans update? - old seq tx needed it anyway */
+ BKE_sequence_single_fix(seq);
break;
case SEQ_RIGHTSEL: /* no vertical transform */
BKE_sequence_tx_set_final_right(seq, new_frame);
BKE_sequence_tx_handle_xlimits(seq, tdsq->flag & SEQ_LEFTSEL, tdsq->flag & SEQ_RIGHTSEL);
- BKE_sequence_single_fix(seq); /* todo - move this into aftertrans update? - old seq tx needed it anyway */
+
+ /* todo - move this into aftertrans update? - old seq tx needed it anyway */
+ BKE_sequence_single_fix(seq);
break;
}
@@ -3042,8 +3067,8 @@ void flushTransSeq(TransInfo *t)
trans_update_seq(t->scene, seq_prev, old_start_prev, sel_flag_prev);
}
-
- if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) { /* originally TFM_TIME_EXTEND, transform changes */
+ /* originally TFM_TIME_EXTEND, transform changes */
+ if (ELEM(t->mode, TFM_SEQ_SLIDE, TFM_TIME_TRANSLATE)) {
/* Special annoying case here, need to calc metas with TFM_TIME_EXTEND only */
/* calc all meta's then effects [#27953] */
@@ -3575,7 +3600,8 @@ static void createTransNlaData(bContext *C, TransInfo *t)
td++;
}
if (FrameOnMouseSide(t->frame_side, strip->end, (float)CFRA)) {
- /* if tdn is already holding the start handle, then we're doing both, otherwise, only end */
+ /* if tdn is already holding the start handle,
+ * then we're doing both, otherwise, only end */
tdn->handle = (tdn->handle) ? 2 : 1;
/* now, link the transform data up to this data */
@@ -3994,7 +4020,8 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC
for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
/* only add selected keyframes (for now, proportional edit is not enabled) */
- if (is_prop_edit || (bezt->f2 & SELECT)) { /* note this MUST match count_fcurve_keys(), so can't use BEZT_ISSEL_ANY() macro */
+ if (is_prop_edit || (bezt->f2 & SELECT)) { /* note this MUST match count_fcurve_keys(),
+ * so can't use BEZT_ISSEL_ANY() macro */
/* only add if on the right 'side' of the current frame */
if (FrameOnMouseSide(side, bezt->vec[1][0], cfra)) {
TimeToTransData(td, bezt->vec[1], adt, ypos);
@@ -4647,7 +4674,8 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
unit_scale = ANIM_unit_mapping_get_factor(ac.scene, ale->id, ale->key_data, anim_map_flag, &offset);
- /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */
+ /* only include BezTriples whose 'keyframe' occurs on the same side
+ * of the current frame as mouse (if applicable) */
for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
if (FrameOnMouseSide(t->frame_side, bezt->vec[1][0], cfra)) {
const bool sel2 = (bezt->f2 & SELECT) != 0;
@@ -4751,7 +4779,8 @@ static void createTransGraphEditData(bContext *C, TransInfo *t)
else
cfra = (float)CFRA;
- /* only include BezTriples whose 'keyframe' occurs on the same side of the current frame as mouse (if applicable) */
+ /* only include BezTriples whose 'keyframe' occurs on the
+ * same side of the current frame as mouse (if applicable) */
for (i = 0, bezt = fcu->bezt; i < fcu->totvert; i++, bezt++) {
if (FrameOnMouseSide(t->frame_side, bezt->vec[1][0], cfra)) {
const bool sel2 = (bezt->f2 & SELECT) != 0;
@@ -5014,7 +5043,9 @@ void flushTransGraphData(TransInfo *t)
a < tc->data_len;
a++, td++, td2d++, tdg++)
{
- AnimData *adt = (AnimData *)td->extra; /* pointers to relevant AnimData blocks are stored in the td->extra pointers */
+ /* pointers to relevant AnimData blocks are stored in the td->extra pointers */
+ AnimData *adt = (AnimData *)td->extra;
+
float inv_unit_scale = 1.0f / tdg->unit_scale;
/* handle snapping for time values
@@ -5434,8 +5465,8 @@ static void freeSeqData(TransInfo *t, TransDataContainer *tc, TransCustomData *c
}
}
else {
- /* Tag seq with a non zero value,
- * used by BKE_sequence_base_shuffle_time to identify the ones to shuffle */
+ /* Tag seq with a non zero value, used by
+ * BKE_sequence_base_shuffle_time to identify the ones to shuffle */
if (seq->depth == 0) {
seq->tmp = (void *)1;
}
@@ -5707,7 +5738,8 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
float rot[3][3], scale[3];
float ctime = BKE_scene_frame_get(scene);
- /* only use rigid body transform if simulation is running, avoids problems with initial setup of rigid bodies */
+ /* only use rigid body transform if simulation is running,
+ * avoids problems with initial setup of rigid bodies */
if (BKE_rigidbody_check_sim_running(scene->rigidbody_world, ctime)) {
/* save original object transform */
@@ -6555,9 +6587,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
FCurve *fcu = (FCurve *)ale->key_data;
/* 3 cases here for curve cleanups:
- * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
+ * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
+ * 2) canceled == 0 -> user confirmed the transform,
+ * so duplicates should be removed
+ * 3) canceled + duplicate -> user canceled the transform,
+ * but we made duplicates, so get rid of these
*/
if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 &&
((canceled == 0) || (duplicate)) )
@@ -6586,9 +6620,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
}
/* 3 cases here for curve cleanups:
- * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
+ * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
+ * 2) canceled == 0 -> user confirmed the transform,
+ * so duplicates should be removed.
+ * 3) canceled + duplicate -> user canceled the transform,
+ * but we made duplicates, so get rid of these.
*/
if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 &&
((canceled == 0) || (duplicate)))
@@ -6599,9 +6635,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
else if (ac.datatype == ANIMCONT_GPENCIL) {
/* remove duplicate frames and also make sure points are in order! */
/* 3 cases here for curve cleanups:
- * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
+ * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
+ * 2) canceled == 0 -> user confirmed the transform,
+ * so duplicates should be removed
+ * 3) canceled + duplicate -> user canceled the transform,
+ * but we made duplicates, so get rid of these
*/
if ((saction->flag & SACTION_NOTRANSKEYCULL) == 0 &&
((canceled == 0) || (duplicate)))
@@ -6687,9 +6725,11 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
FCurve *fcu = (FCurve *)ale->key_data;
/* 3 cases here for curve cleanups:
- * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
- * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed
- * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these
+ * 1) NOTRANSKEYCULL on -> cleanup of duplicates shouldn't be done
+ * 2) canceled == 0 -> user confirmed the transform,
+ * so duplicates should be removed
+ * 3) canceled + duplicate -> user canceled the transform,
+ * but we made duplicates, so get rid of these
*/
if ((sipo->flag & SIPO_NOTRANSKEYCULL) == 0 &&
((canceled == 0) || (duplicate)))
@@ -6761,7 +6801,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
}
else if (t->flag & T_POSE && (t->mode == TFM_BONESIZE)) {
/* Handle the exception where for TFM_BONESIZE in edit mode we pretend to be
- * in pose mode (to use bone orientation matrix), in that case we don't do operations like autokeyframing. */
+ * in pose mode (to use bone orientation matrix),
+ * in that case we don't do operations like autokeyframing. */
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
ob = tc->poseobj;
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
@@ -6806,7 +6847,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
if (t->mode == TFM_TRANSLATION)
pose_grab_with_ik_clear(bmain, ob);
- /* automatic inserting of keys and unkeyed tagging - only if transform wasn't canceled (or TFM_DUMMY) */
+ /* automatic inserting of keys and unkeyed tagging -
+ * only if transform wasn't canceled (or TFM_DUMMY) */
if (!canceled && (t->mode != TFM_DUMMY)) {
autokeyframe_pose(C, t->scene, ob, t->mode, targetless_ik);
DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
@@ -6871,8 +6913,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t)
/* flag object caches as outdated */
BKE_ptcache_ids_from_object(&pidlist, ob, t->scene, MAX_DUPLI_RECUR);
for (pid = pidlist.first; pid; pid = pid->next) {
- if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
+ if (pid->type != PTCACHE_TYPE_PARTICLES) {
+ /* particles don't need reset on geometry change */
pid->cache->flag |= PTCACHE_OUTDATED;
+ }
}
BLI_freelistN(&pidlist);
@@ -6989,7 +7033,8 @@ static void createTransObject(bContext *C, TransInfo *t)
for (base = view_layer->object_bases.first; base; base = base->next) {
Object *ob = base->object;
- /* if base is not selected, not a parent of selection or not a child of selection and it is editable */
+ /* if base is not selected, not a parent of selection
+ * or not a child of selection and it is editable */
if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 &&
(base->flag & BASE_SELECTED) == 0 &&
BASE_EDITABLE(v3d, base))
@@ -8450,7 +8495,8 @@ static void createTransGPencil(bContext *C, TransInfo *t)
if (point_ok) {
copy_v3_v3(td->iloc, &pt->x);
/* only copy center in local origins.
- * This allows get interesting effects also when move using proportional editing */
+ * This allows get interesting effects also when move
+ * using proportional editing */
if ((gps->flag & GP_STROKE_SELECT) &&
(ts->transform_pivot_point == V3D_AROUND_LOCAL_ORIGINS))
{
@@ -8492,7 +8538,8 @@ static void createTransGPencil(bContext *C, TransInfo *t)
copy_m3_m4(td->mtx, diff_mat); /* display position */
copy_m3_m4(td->axismtx, diff_mat); /* axis orientation */
- /* Triangulation must be calculated again, so save the stroke for recalc function */
+ /* Triangulation must be calculated again,
+ * so save the stroke for recalc function */
td->extra = gps;
/* save pointer to object */
@@ -8647,7 +8694,8 @@ void createTransData(bContext *C, TransInfo *t)
if (t->data_len_all && (t->flag & T_PROP_EDIT)) {
sort_trans_data(t); // makes selected become first in array
- //set_prop_dist(t, false); /* don't do that, distance has been set in createTransActionData already */
+ /* don't do that, distance has been set in createTransActionData already */
+ //set_prop_dist(t, false);
sort_trans_data_dist(t);
}
}
@@ -8662,7 +8710,7 @@ void createTransData(bContext *C, TransInfo *t)
t->flag |= T_POINTS | T_2D_EDIT;
t->obedit_type = -1;
- t->num.flag |= NUM_NO_FRACTION; /* sequencer has no use for floating point transformations */
+ t->num.flag |= NUM_NO_FRACTION; /* sequencer has no use for floating point trasnform */
createTransSeqData(C, t);
countAndCleanTransDataContainer(t);
}
@@ -8674,8 +8722,12 @@ void createTransData(bContext *C, TransInfo *t)
countAndCleanTransDataContainer(t);
if (t->data_len_all && (t->flag & T_PROP_EDIT)) {
- sort_trans_data(t); // makes selected become first in array
- set_prop_dist(t, false); /* don't do that, distance has been set in createTransGraphEditData already */
+ /* makes selected become first in array */
+ sort_trans_data(t);
+
+ /* don't do that, distance has been set in createTransGraphEditData already */
+ set_prop_dist(t, false);
+
sort_trans_data_dist(t);
}
}
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 5f7d3ec5bde..ed16d943f5d 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -280,7 +280,8 @@ static void animrecord_check_state(Scene *scene, ID *id, wmTimer *animtimer)
* - the option to add new actions for each round is not enabled
*/
if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL) == 0 && (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) {
- /* if playback has just looped around, we need to add a new NLA track+strip to allow a clean pass to occur */
+ /* if playback has just looped around,
+ * we need to add a new NLA track+strip to allow a clean pass to occur */
if ((sad) && (sad->flag & ANIMPLAY_FLAG_JUMPED)) {
AnimData *adt = BKE_animdata_from_id(id);
const bool is_first = (adt) && (adt->nla_tracks.first == NULL);
@@ -573,7 +574,8 @@ static void recalcData_nla(TransInfo *t)
if (t->state != TRANS_CANCEL) {
switch (snla->autosnap) {
case SACTSNAP_FRAME: /* snap to nearest frame */
- case SACTSNAP_STEP: /* frame step - this is basically the same, since we don't have any remapping going on */
+ case SACTSNAP_STEP: /* frame step - this is basically the same,
+ * since we don't have any remapping going on */
{
tdn->h1[0] = floorf(tdn->h1[0] + 0.5f);
tdn->h2[0] = floorf(tdn->h2[0] + 0.5f);
@@ -581,7 +583,8 @@ static void recalcData_nla(TransInfo *t)
}
case SACTSNAP_SECOND: /* snap to nearest second */
- case SACTSNAP_TSTEP: /* second step - this is basically the same, since we don't have any remapping going on */
+ case SACTSNAP_TSTEP: /* second step - this is basically the same,
+ * since we don't have any remapping going on */
{
/* This case behaves differently from the rest, since lengths of strips
* may not be multiples of a second. If we just naively resize adjust
@@ -779,7 +782,8 @@ static void recalcData_objects(TransInfo *t)
if (t->state == TRANS_CANCEL) {
while (nu) {
- BKE_nurb_handles_calc(nu); /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */
+ /* Cant do testhandlesNurb here, it messes up the h1 and h2 flags */
+ BKE_nurb_handles_calc(nu);
nu = nu->next;
}
}
diff --git a/source/blender/editors/transform/transform_gizmo_3d.c b/source/blender/editors/transform/transform_gizmo_3d.c
index 0bfe3582d04..03851e5f0cf 100644
--- a/source/blender/editors/transform/transform_gizmo_3d.c
+++ b/source/blender/editors/transform/transform_gizmo_3d.c
@@ -2265,7 +2265,8 @@ static void WIDGETGROUP_xform_shear_draw_prepare(const bContext *C, wmGizmoGroup
LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) {
/* Since we have two pairs of each axis,
* bias the values so gizmos that are orthogonal to the view get priority.
- * This means we never default to shearing along the view axis in the case of an overlap. */
+ * This means we never default to shearing along
+ * the view axis in the case of an overlap. */
float axis_order[3], axis_bias[3];
copy_v3_v3(axis_order, gz->matrix_basis[2]);
copy_v3_v3(axis_bias, gz->matrix_basis[1]);
diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c
index 190bc57fcfd..75606b84ea0 100644
--- a/source/blender/editors/transform/transform_input.c
+++ b/source/blender/editors/transform/transform_input.c
@@ -197,7 +197,8 @@ static void InputAngle(TransInfo *UNUSED(t), MouseInput *mi, const double mval[2
double dx3 = mval[0] - data->mval_prev[0];
double dy3 = mval[1] - data->mval_prev[1];
- /* use doubles here, to make sure a "1.0" (no rotation) doesn't become 9.999999e-01, which gives 0.02 for acos */
+ /* use doubles here, to make sure a "1.0" (no rotation)
+ * doesn't become 9.999999e-01, which gives 0.02 for acos */
double deler = (((dx1 * dx1 + dy1 * dy1) +
(dx2 * dx2 + dy2 * dy2) -
(dx3 * dx3 + dy3 * dy3)) / (2.0 * (((A * B) != 0.0) ? (A * B) : 1.0)));
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c
index 6bef5e4671a..1c53978ebaf 100644
--- a/source/blender/editors/transform/transform_ops.c
+++ b/source/blender/editors/transform/transform_ops.c
@@ -409,7 +409,8 @@ static int transform_modal(bContext *C, wmOperator *op, const wmEvent *event)
/* XXX, workaround: active needs to be calculated before transforming,
* since we're not reading from 'td->center' in this case. see: T40241 */
if (t->tsnap.target == SCE_SNAP_TARGET_ACTIVE) {
- /* In camera view, tsnap callback is not set (see initSnappingMode() in transfrom_snap.c, and T40348). */
+ /* In camera view, tsnap callback is not set
+ * (see initSnappingMode() in transfrom_snap.c, and T40348). */
if (t->tsnap.targetSnap && ((t->tsnap.status & TARGET_INIT) == 0)) {
t->tsnap.targetSnap(t);
}
@@ -589,7 +590,8 @@ void Transform_Properties(struct wmOperatorType *ot, int flags)
RNA_def_enum(ot->srna, "proportional", rna_enum_proportional_editing_items, 0, "Proportional Editing", "");
prop = RNA_def_enum(ot->srna, "proportional_edit_falloff", rna_enum_proportional_falloff_items, 0,
"Proportional Falloff", "Falloff type for proportional editing mode");
- RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE); /* Abusing id_curve :/ */
+ /* Abusing id_curve :/ */
+ RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_CURVE);
RNA_def_float(ot->srna, "proportional_size", 1, T_PROP_SIZE_MIN, T_PROP_SIZE_MAX,
"Proportional Size", "", 0.001f, 100.0f);
}
diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c
index 9cf71dc4cf4..677da81127d 100644
--- a/source/blender/editors/transform/transform_snap.c
+++ b/source/blender/editors/transform/transform_snap.c
@@ -1590,7 +1590,8 @@ static void applyGridIncrement(TransInfo *t, float *val, int max_index, const fl
float grid_p = iter_fac * roundf(pos_on_axis[j] / iter_fac);
float dist_p = fabs((grid_p - pos_on_axis[j]) / local_axis[j]);
- /* The amount of distance needed to travel along the local axis to snap to the closest grid point */
+ /* The amount of distance needed to travel along the
+ * local axis to snap to the closest grid point */
/* in the global j axis direction */
float move_dist = (grid_p - center_global[j]) / local_axis[j];
diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c
index 94766262711..b954aa27d74 100644
--- a/source/blender/editors/transform/transform_snap_object.c
+++ b/source/blender/editors/transform/transform_snap_object.c
@@ -995,7 +995,8 @@ static bool test_projected_edge_dist(
typedef void (*Nearest2DGetVertCoCallback)(const int index, const float **co, void *data);
typedef void (*Nearest2DGetEdgeVertsCallback)(const int index, int v_index[2], void *data);
typedef void (*Nearest2DGetTriVertsCallback)(const int index, int v_index[3], void *data);
-typedef void (*Nearest2DGetTriEdgesCallback)(const int index, int e_index[3], void *data); /* Equal the previous one */
+/* Equal the previous one */
+typedef void (*Nearest2DGetTriEdgesCallback)(const int index, int e_index[3], void *data);
typedef void (*Nearest2DCopyVertNoCallback)(const int index, float r_no[3], void *data);
typedef struct Nearest2dUserData {
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 720b8357a12..5cc1f15cb2e 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -166,7 +166,8 @@ void ED_editors_exit(Main *bmain, bool do_undo_system)
/* frees all editmode undos */
if (do_undo_system && G_MAIN->wm.first) {
wmWindowManager *wm = G_MAIN->wm.first;
- /* normally we don't check for NULL undo stack, do here since it may run in different context. */
+ /* normally we don't check for NULL undo stack,
+ * do here since it may run in different context. */
if (wm->undo_stack) {
BKE_undosys_stack_destroy(wm->undo_stack);
wm->undo_stack = NULL;
@@ -208,7 +209,8 @@ bool ED_editors_flush_edits(Main *bmain, bool for_render)
for (ob = bmain->object.first; ob; ob = ob->id.next) {
if (ob->mode & OB_MODE_SCULPT) {
/* Don't allow flushing while in the middle of a stroke (frees data in use).
- * Auto-save prevents this from happening but scripts may cause a flush on saving: T53986. */
+ * Auto-save prevents this from happening but scripts
+ * may cause a flush on saving: T53986. */
if ((ob->sculpt && ob->sculpt->cache) == 0) {
/* flush multires changes (for sculpt) */
multires_force_update(ob);
diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c
index 817b12fbc4d..b01ace077ba 100644
--- a/source/blender/editors/util/numinput.c
+++ b/source/blender/editors/util/numinput.c
@@ -51,23 +51,30 @@
/* Numeric input which isn't allowing full numeric editing. */
#define USE_FAKE_EDIT
-/* NumInput.flag */
+/** #NumInput.flag
+ * (1 << 8) and below are reserved for public flags!
+ */
enum {
- /* (1 << 8) and below are reserved for public flags! */
- NUM_EDIT_FULL = (1 << 9), /* Enable full editing, with units and math operators support. */
+ /** Enable full editing, with units and math operators support. */
+ NUM_EDIT_FULL = (1 << 9),
#ifdef USE_FAKE_EDIT
- NUM_FAKE_EDITED = (1 << 10), /* Fake edited state (temp, avoids issue with backspace). */
+ /** Fake edited state (temp, avoids issue with backspace). */
+ NUM_FAKE_EDITED = (1 << 10),
#endif
};
/* NumInput.val_flag[] */
enum {
/* (1 << 8) and below are reserved for public flags! */
- NUM_EDITED = (1 << 9), /* User has edited this value somehow. */
- NUM_INVALID = (1 << 10), /* Current expression for this value is invalid. */
+ /** User has edited this value somehow. */
+ NUM_EDITED = (1 << 9),
+ /** Current expression for this value is invalid. */
+ NUM_INVALID = (1 << 10),
#ifdef USE_FAKE_EDIT
- NUM_NEGATE = (1 << 11), /* Current expression's result has to be negated. */
- NUM_INVERSE = (1 << 12), /* Current expression's result has to be inverted. */
+ /** Current expression's result has to be negated. */
+ NUM_NEGATE = (1 << 11),
+ /** Current expression's result has to be inverted. */
+ NUM_INVERSE = (1 << 12),
#endif
};
@@ -134,7 +141,8 @@ void outputNumInput(NumInput *n, char *str, UnitSettings *unit_settings)
n->unit_sys, n->unit_type[i], true, false);
}
- BLI_strncpy(before_cursor, n->str, n->str_cur + 1); /* +1 because of trailing '\0' */
+ /* +1 because of trailing '\0' */
+ BLI_strncpy(before_cursor, n->str, n->str_cur + 1);
BLI_snprintf(&str[j * ln], ln, "[%s%s|%s%s] = %s",
heading_exp, before_cursor, &n->str[n->str_cur], trailing_exp, val);
}
@@ -155,7 +163,8 @@ void outputNumInput(NumInput *n, char *str, UnitSettings *unit_settings)
const char *cur = (i == n->idx) ? "|" : "";
BLI_snprintf(&str[j * ln], ln, "%sNONE%s", cur, cur);
}
- /* We might have cut some multi-bytes utf8 chars (e.g. trailing '°' of degrees values can become only 'A')... */
+ /* We might have cut some multi-bytes utf8 chars
+ * (e.g. trailing '°' of degrees values can become only 'A')... */
BLI_utf8_invalid_strip(&str[j * ln], strlen(&str[j * ln]));
}
}
@@ -354,7 +363,8 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
updated = true;
break;
}
- /* Else, common behavior with DELKEY, only difference is remove char(s) before/after the cursor. */
+ /* Else, common behavior with DELKEY,
+ * only difference is remove char(s) before/after the cursor. */
dir = STRCUR_DIR_PREV;
ATTR_FALLTHROUGH;
case DELKEY:
@@ -369,7 +379,8 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
SWAP(int, t_cur, cur);
n->str_cur = cur;
}
- memmove(&n->str[cur], &n->str[t_cur], strlen(&n->str[t_cur]) + 1); /* +1 for trailing '\0'. */
+ /* +1 for trailing '\0'. */
+ memmove(&n->str[cur], &n->str[t_cur], strlen(&n->str[t_cur]) + 1);
updated = true;
}
if (!n->str[0]) {
@@ -423,7 +434,8 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
return true;
case PADPERIOD:
case PERIODKEY:
- /* Force numdot, some OSs/countries generate a comma char in this case, sic... (T37992) */
+ /* Force numdot, some OSs/countries generate a comma char in this case,
+ * sic... (T37992) */
ascii[0] = '.';
utf8_buf = ascii;
break;
@@ -542,7 +554,8 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
return false;
}
- /* At this point, our value has changed, try to interpret it with python (if str is not empty!). */
+ /* At this point, our value has changed, try to interpret it with python
+ * (if str is not empty!). */
if (n->str[0]) {
const float val_prev = n->val[idx];
Scene *sce = CTX_data_scene(C);
@@ -565,7 +578,8 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event)
}
if (n->val_flag[idx] & NUM_INVERSE) {
val = n->val[idx];
- /* If we invert on radians when user is in degrees, you get unexpected results... See T53463. */
+ /* If we invert on radians when user is in degrees,
+ * you get unexpected results... See T53463. */
if (!n->unit_use_radians && n->unit_type[idx] == B_UNIT_ROTATION) {
val = RAD2DEG(val);
}
diff --git a/source/blender/editors/uvedit/uvedit_buttons.c b/source/blender/editors/uvedit/uvedit_buttons.c
index 4af46ffa610..f9e7fadb70a 100644
--- a/source/blender/editors/uvedit/uvedit_buttons.c
+++ b/source/blender/editors/uvedit/uvedit_buttons.c
@@ -237,7 +237,7 @@ void ED_uvedit_buttons_register(ARegionType *art)
pt = MEM_callocN(sizeof(PanelType), "spacetype image panel uv");
strcpy(pt->idname, "IMAGE_PT_uv");
- strcpy(pt->label, N_("UV Vertex")); /* XXX C panels are not available through RNA (bpy.types)! */
+ strcpy(pt->label, N_("UV Vertex")); /* XXX C panels unavailable through RNA bpy.types! */
pt->draw = image_panel_uv;
pt->poll = image_panel_uv_poll;
BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c
index 356f24e0758..4aa3f8fd08a 100644
--- a/source/blender/editors/uvedit/uvedit_draw.c
+++ b/source/blender/editors/uvedit/uvedit_draw.c
@@ -384,7 +384,8 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph *
UI_GetThemeColor4fv(TH_WIRE_EDIT, col1);
UI_GetThemeColor4fv(TH_EDGE_SELECT, col2);
- /* We could modify the vbo's data filling instead of modifying the provoking vert. */
+ /* We could modify the vbo's data filling
+ * instead of modifying the provoking vert. */
glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);
GPU_line_width(1.0f);
diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c
index bb0c11b171b..bb56f9f18b0 100644
--- a/source/blender/editors/uvedit/uvedit_ops.c
+++ b/source/blender/editors/uvedit/uvedit_ops.c
@@ -2328,7 +2328,9 @@ static int uv_mouse_select_multi(
UvNearestHit hit = UV_NEAREST_HIT_INIT;
int i, selectmode, sticky, sync, *hitv = NULL;
bool select = true;
- int flush = 0, hitlen = 0; /* 0 == don't flush, 1 == sel, -1 == desel; only use when selection sync is enabled */
+ /* 0 == don't flush, 1 == sel, -1 == desel; only use when selection sync is enabled */
+ int flush = 0;
+ int hitlen = 0;
float limit[2], **hituv = NULL;
/* notice 'limit' is the same no matter the zoom level, since this is like
@@ -2460,7 +2462,8 @@ static int uv_mouse_select_multi(
/* TODO(MULTI_EDIT): We only need to de-select non-active */
uv_select_all_perform_multi(scene, ima, objects, objects_len, SEL_DESELECT);
}
- /* Current behavior of 'extend' is actually toggling, so pass extend flag as 'toggle' here */
+ /* Current behavior of 'extend'
+ * is actually toggling, so pass extend flag as 'toggle' here */
uv_select_linked_multi(scene, ima, objects, objects_len, limit, &hit, false, false, extend, false);
}
else if (extend) {
@@ -4453,7 +4456,8 @@ static int uv_seams_from_islands_exec(bContext *C, wmOperator *op)
UvMapVert *mv1, *mvinit1, *mv2, *mvinit2, *mviter;
/* mv2cache stores the first of the list of coincident uv's for later comparison
- * mv2sep holds the last separator and is copied to mv2cache when a hit is first found */
+ * mv2sep holds the last separator and is copied to mv2cache
+ * when a hit is first found */
UvMapVert *mv2cache = NULL, *mv2sep = NULL;
mvinit1 = vmap->vert[BM_elem_index_get(editedge->v1)];
diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c
index ded4a4899c7..7a96bc60fd4 100644
--- a/source/blender/editors/uvedit/uvedit_parametrizer.c
+++ b/source/blender/editors/uvedit/uvedit_parametrizer.c
@@ -4547,7 +4547,8 @@ void param_pack(ParamHandle *handle, float margin, bool do_rotate, bool ignore_p
if (margin > 0.0f) {
/* multiply the margin by the area to give predictable results not dependent on UV scale,
* ...Without using the area running pack multiple times also gives a bad feedback loop.
- * multiply by 0.1 so the margin value from the UI can be from 0.0 to 1.0 but not give a massive margin */
+ * multiply by 0.1 so the margin value from the UI can be from
+ * 0.0 to 1.0 but not give a massive margin */
margin = (margin * (float)area) * 0.1f;
unpacked = 0;
for (i = 0; i < phandle->ncharts; i++) {
diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c
index 4c8d8b77513..4f770d82db8 100644
--- a/source/blender/editors/uvedit/uvedit_smart_stitch.c
+++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c
@@ -89,7 +89,8 @@ typedef struct StitchPreviewer {
unsigned int *uvs_per_polygon;
/*number of preview polygons */
unsigned int num_polys;
- /* preview data. These will be either the previewed vertices or edges depending on stitch mode settings */
+ /* preview data. These will be either the previewed vertices or edges
+ * depending on stitch mode settings */
float *preview_stitchable;
float *preview_unstitchable;
/* here we'll store the number of elements to be drawn */
@@ -134,16 +135,19 @@ typedef struct UVVertAverage {
} UVVertAverage;
typedef struct UvEdge {
- /* index to uv buffer */
+ /** index to uv buffer */
unsigned int uv1;
unsigned int uv2;
- /* general use flag (Used to check if edge is boundary here, and propagates to adjacency elements) */
+ /** general use flag
+ * (Used to check if edge is boundary here, and propagates to adjacency elements) */
unsigned char flag;
- /* element that guarantees element->face has the edge on element->tfindex and element->tfindex+1 is the second uv */
+ /** element that guarantees element->face
+ * has the edge on element->tfindex and element->tfindex+1 is the second uv */
UvElement *element;
- /* next uv edge with the same exact vertices as this one.. Calculated at startup to save time */
+ /** next uv edge with the same exact vertices as this one.
+ * Calculated at startup to save time */
struct UvEdge *next;
- /* point to first of common edges. Needed for iteration */
+ /** point to first of common edges. Needed for iteration */
struct UvEdge *first;
} UvEdge;
@@ -347,7 +351,8 @@ static void stitch_uv_rotate(float mat[2][2], float medianPoint[2], float uv[2],
uv[1] *= aspect;
}
-/* check if two uvelements are stitchable. This should only operate on -different- separate UvElements */
+/* check if two uvelements are stitchable.
+ * This should only operate on -different- separate UvElements */
static bool stitch_check_uvs_stitchable(
UvElement *element, UvElement *element_iter,
StitchStateContainer *ssc, StitchState *state)
@@ -566,8 +571,9 @@ static void stitch_island_calculate_edge_rotation(
index1 = edge->uv1;
index2 = edge->uv2;
}
- /* the idea here is to take the directions of the edges and find the rotation between final and initial
- * direction. This, using inner and outer vector products, gives the angle. Directions are differences so... */
+ /* the idea here is to take the directions of the edges and find the rotation between
+ * final and initial direction. This, using inner and outer vector products,
+ * gives the angle. Directions are differences so... */
uv1[0] = luv2->uv[0] - luv1->uv[0];
uv1[1] = luv2->uv[1] - luv1->uv[1];
@@ -770,7 +776,8 @@ static void stitch_uv_edge_generate_linked_edges(GHash *edge_hash, StitchState *
* I am not too sure we want this though */
last_set->next = edge2;
last_set = edge2;
- /* set first, similarly to uv elements. Now we can iterate among common edges easily */
+ /* set first, similarly to uv elements.
+ * Now we can iterate among common edges easily */
edge2->first = edge;
}
}
@@ -1063,7 +1070,8 @@ static int stitch_process_data(
while (!(island_stitch_data[ssc->static_island].stitchableCandidate)) {
ssc->static_island++;
ssc->static_island %= state->element_map->totalIslands;
- /* this is entirely possible if for example limit stitching with no stitchable verts or no selection */
+ /* this is entirely possible if for example limit stitching
+ * with no stitchable verts or no selection */
if (ssc->static_island == previous_island) {
break;
}
@@ -1219,7 +1227,8 @@ static int stitch_process_data(
/* copy data from MLoopUVs to the preview display buffers */
BM_ITER_MESH (efa, &iter, bm, BM_FACES_OF_MESH) {
- /* just to test if face was added for processing. uvs of unselected vertices will return NULL */
+ /* just to test if face was added for processing.
+ * uvs of unselected vertices will return NULL */
UvElement *element = BM_uv_element_get(state->element_map, efa, BM_FACE_FIRST_LOOP(efa));
if (element) {
@@ -1366,7 +1375,8 @@ static int stitch_process_data(
}
}
- /* take mean position here. For edge case, this can't be done inside the loop for shared uvverts */
+ /* take mean position here.
+ * For edge case, this can't be done inside the loop for shared uvverts */
if (ssc->mode == STITCH_EDGE && stitch_midpoints) {
for (i = 0; i < state->total_separate_uvs; i++) {
final_position[i].uv[0] /= final_position[i].count;
@@ -1899,7 +1909,8 @@ static StitchState *stitch_init(
}
}
- /* explicitly set preview to NULL, to avoid deleting an invalid pointer on stitch_process_data */
+ /* explicitly set preview to NULL,
+ * to avoid deleting an invalid pointer on stitch_process_data */
state->stitch_preview = NULL;
/* Allocate the unique uv buffers */
state->uvs = MEM_mallocN(sizeof(*state->uvs) * counter, "uv_stitch_unique_uvs");
@@ -2493,9 +2504,9 @@ static StitchState *stitch_select(
if (ssc->mode == STITCH_VERT) {
if (uv_find_nearest_vert_multi(scene, ima, ssc->objects, ssc->objects_len, co, 0.0f, &hit)) {
- /* Add vertex to selection, deselect all common uv's of vert other
- * than selected and update the preview. This behavior was decided so that
- * you can do stuff like deselect the opposite stitchable vertex and the initial still gets deselected */
+ /* Add vertex to selection, deselect all common uv's of vert other than selected and
+ * update the preview. This behavior was decided so that you can do stuff like deselect
+ * the opposite stitchable vertex and the initial still gets deselected */
/* find StitchState from hit->ob */
StitchState *state = NULL;
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 6c818a6a75e..93ba2f62029 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -470,7 +470,8 @@ static ParamHandle *construct_param_handle_subsurfed(Scene *scene, Object *ob, B
/* number of vertices and faces for subsurfed mesh*/
int numOfEdges, numOfFaces;
- /* holds a map to editfaces for every subsurfed MFace. These will be used to get hidden/ selected flags etc. */
+ /* holds a map to editfaces for every subsurfed MFace.
+ * These will be used to get hidden/ selected flags etc. */
BMFace **faceMap;
/* similar to the above, we need a way to map edges to their original ones */
BMEdge **edgeMap;
@@ -1432,7 +1433,8 @@ static int unwrap_exec(bContext *C, wmOperator *op)
const bool use_subsurf = RNA_boolean_get(op->ptr, "use_subsurf_data");
bool implicit = false;
int reported_errors = 0;
- /* We will report an error unless at least one object has the subsurf modifier in the right place. */
+ /* We will report an error unless at least one object
+ * has the subsurf modifier in the right place. */
bool subsurf_error = use_subsurf;
uint objects_len = 0;
@@ -2107,7 +2109,8 @@ void ED_uvedit_add_simple_uvs(Main *bmain, Scene *scene, Object *ob)
&bm_mesh_allocsize_default,
&((struct BMeshCreateParams){.use_toolflags = false,}));
- /* turn sync selection off, since we are not in edit mode we need to ensure only the uv flags are tested */
+ /* turn sync selection off,
+ * since we are not in edit mode we need to ensure only the uv flags are tested */
scene->toolsettings->uv_flag &= ~UV_SYNC_SELECTION;
ED_mesh_uv_texture_ensure(me, NULL);