diff options
169 files changed, 1771 insertions, 912 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 8c306ab0159..de268b4c1cd 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -3522,7 +3522,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? @@ -4348,7 +4349,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; @@ -4536,7 +4538,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 8900e19def4..e5758c187b7 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -877,7 +877,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 */ @@ -1556,7 +1557,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); } /* ----------------------------------------------------------- */ @@ -2997,17 +2999,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 a21bc4989b5..7fa049abbe3 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -213,7 +213,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 e7430b5283c..4dcf7f9d5e9 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -879,7 +879,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; @@ -972,7 +973,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,8 +1268,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) @@ -1289,9 +1294,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) */ @@ -1314,7 +1319,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); } @@ -1727,7 +1733,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) @@ -3252,7 +3259,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/drivers.c b/source/blender/editors/animation/drivers.c index ebe085cd006..e6025fe1eed 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -327,7 +327,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 3136b3e7137..9e1235dbd45 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -349,9 +349,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 54e0839d802..ef8b56cda22 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -873,9 +873,10 @@ void summary_to_keylist(bAnimContext *ac, DLRBT_Tree *keys, DLRBT_Tree *blocks) /* 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 c8b0ed391f9..303afd698ff 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 */ @@ -672,25 +673,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; @@ -700,7 +711,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 */ @@ -720,7 +734,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 9ea43c160a6..9a98af2f79d 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -443,11 +443,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 e4aeef72755..b164db6f5b3 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -1024,7 +1024,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_edit.c b/source/blender/editors/armature/armature_edit.c index 1ba64a61d7c..1dec207ced5 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -85,7 +85,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 e4ce1d58208..dec67caacb1 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -141,7 +141,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); @@ -538,7 +539,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; } } diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 46e1b868520..4936136763b 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -627,7 +627,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; @@ -660,8 +662,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/pose_lib.c b/source/blender/editors/armature/pose_lib.c index 1aa852c3863..9c2bb70b460 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 */ @@ -728,7 +731,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); @@ -942,7 +946,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) */ } } @@ -1765,7 +1770,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_slide.c b/source/blender/editors/armature/pose_slide.c index 2980bf4637e..bee2d22f7c0 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -95,10 +95,13 @@ typedef struct tPoseSlideOp { ListBase pfLinks; /* links between posechannels and f-curves */ DLRBT_Tree keys; /* binary tree for quicker searching for keyframes (when applicable) */ - 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; float prevFrameF; /* prevFrame, but in local action time (for F-Curve lookups to work) */ float nextFrameF; /* nextFrame, but in local action time (for F-Curve lookups to work) */ @@ -106,10 +109,13 @@ typedef struct tPoseSlideOp { short mode; /* sliding mode (ePoseSlide_Modes) */ short flag; /* unused for now, but can later get used for storing runtime settings.... */ - 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 */ } tPoseSlideOp; @@ -310,7 +316,8 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *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; @@ -323,7 +330,8 @@ static void pose_slide_apply_val(tPoseSlideOp *pso, FCurve *fcu, float *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; @@ -522,7 +530,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 f21d990a19e..27c2ff69668 100644 --- a/source/blender/editors/armature/pose_transform.c +++ b/source/blender/editors/armature/pose_transform.c @@ -104,7 +104,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; } @@ -731,7 +731,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/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 342eef063f4..f3761812696 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -156,8 +156,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); @@ -176,8 +177,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); @@ -1259,8 +1261,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); } } @@ -2137,7 +2140,8 @@ static void adduplicateflagNurb(Object *obedit, 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 { @@ -2621,7 +2625,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) { @@ -2691,7 +2696,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) { diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c index a6100d9bb14..f3b9143014d 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/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index a5c6fd8b8cf..9435184bfaf 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -607,7 +607,8 @@ static bool gp_brush_twist_apply(tGP_BrushEditData *gso, bGPDstroke *gps, int i, 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 9f94cf3beb8..bea294ada6f 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -1165,7 +1165,8 @@ static void gp_layer_to_curve(bContext *C, ReportList *reports, bGPdata *gpd, bG 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_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 312521d3ffb..cd228afb99f 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -2156,13 +2156,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_interpolate.c b/source/blender/editors/gpencil/gpencil_interpolate.c index e2d70803695..9dc8c1f5cc9 100644 --- a/source/blender/editors/gpencil/gpencil_interpolate.c +++ b/source/blender/editors/gpencil/gpencil_interpolate.c @@ -1073,7 +1073,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 27cde27fdf7..12ba0343745 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -2199,7 +2199,8 @@ static void gpencil_draw_apply_event(wmOperator *op, const wmEvent *event) gpencil_draw_apply(op, p); /* 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); } /* ------------------------------- */ @@ -2771,7 +2772,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_SKIP_SAVE); } diff --git a/source/blender/editors/gpencil/gpencil_select.c b/source/blender/editors/gpencil/gpencil_select.c index 7bb0c005184..784f77d15e8 100644 --- a/source/blender/editors/gpencil/gpencil_select.c +++ b/source/blender/editors/gpencil/gpencil_select.c @@ -772,7 +772,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/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index b805b2ea0ff..526f42a5bbf 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -114,37 +114,51 @@ 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; void *owner; /* for per-element F-Curves (e.g. NLA Control Curves), the element that this represents (e.g. NlaStrip) */ } 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, @@ -231,42 +245,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; @@ -409,30 +427,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; @@ -522,7 +552,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 9ad716cf07c..5c9618aba6c 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -54,26 +54,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 */ @@ -83,7 +89,8 @@ typedef struct EditBone { float ease1, ease2; float scaleIn, scaleOut; - float oldlength; /* for envelope scaling */ + /** for envelope scaling */ + float oldlength; short segments; diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index e2c8ecf6812..82037bdfc1a 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -123,8 +123,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 a29057197ed..5f4b8ce40bf 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -55,9 +55,12 @@ 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 */ 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 b3496b1c088..b4d1b5dec9c 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -189,7 +189,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 */ @@ -197,7 +198,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 */ @@ -234,18 +236,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 00558a3a787..88cb702acde 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 */ + /** 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]; - 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) */ + /** 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 d40c4f8dec9..3f96d669f1c 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -158,7 +158,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(struct wmOperatorType *ot); diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index 2b1ce461b0e..0e78fca3459 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; /* for editing areas/regions */ 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 c21a6cccb2e..9dce4a76df5 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -123,11 +123,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 48c917040f7..429f967daab 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -439,7 +439,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); diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 94b17209655..97520f00bf0 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -150,7 +150,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; @@ -413,7 +414,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; @@ -1950,7 +1952,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 { @@ -2155,7 +2158,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); @@ -2385,7 +2389,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]; @@ -3415,7 +3420,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, ""); } } @@ -4441,7 +4447,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; } @@ -4490,7 +4497,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), 0)) break; diff --git a/source/blender/editors/interface/interface_align.c b/source/blender/editors/interface/interface_align.c index 36b0b938b5a..8e0cfa79289 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, @@ -146,14 +151,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) { @@ -162,18 +170,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; @@ -201,10 +212,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; @@ -217,7 +230,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; } } @@ -313,9 +327,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; } @@ -370,27 +385,29 @@ void ui_block_align_calc(uiBlock *block) } /* 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 10a23792e8f..5204127ee63 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -183,7 +183,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 54e755f6cc6..ed6d590edf3 100644 --- a/source/blender/editors/interface/interface_context_menu.c +++ b/source/blender/editors/interface/interface_context_menu.c @@ -52,7 +52,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 /* -------------------------------------------------------------------- */ @@ -130,7 +131,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; @@ -277,7 +279,8 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but) /*bool is_idprop = RNA_property_is_idprop(prop);*/ /* XXX does not work as expected, not strictly needed */ 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); diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 13acc632929..7e3bc7e257c 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -630,7 +630,8 @@ void ui_draw_but_WAVEFORM(ARegion *ar, uiBut *but, uiWidgetColors *UNUSED(wcol), GLint 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 43ccd65ddf2..21b34addb7a 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 ac60140e2d8..bae4a3f089f 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -232,10 +232,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 */ @@ -244,11 +248,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 @@ -325,8 +330,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 @@ -1319,7 +1326,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])) @@ -1580,18 +1588,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 @@ -3302,7 +3314,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); @@ -3340,7 +3353,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; @@ -3788,7 +3802,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; @@ -4304,7 +4319,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 */ @@ -4397,8 +4413,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; click = 1; @@ -4698,8 +4716,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; @@ -4714,7 +4734,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; @@ -4819,7 +4840,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 @@ -6075,7 +6097,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); @@ -6243,7 +6266,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' */ @@ -7173,7 +7197,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; @@ -7916,7 +7941,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)) { @@ -7952,7 +7978,8 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) retval = WM_UI_HANDLER_CONTINUE; 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: @@ -8182,7 +8209,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; @@ -8970,7 +8998,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; @@ -9214,7 +9243,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) { @@ -9361,7 +9391,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.pie_menu_threshold + U.pie_menu_confirm)) { @@ -9479,7 +9510,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) { @@ -9743,7 +9775,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 7ef95ca87d4..871f72f948c 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -473,7 +473,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); @@ -1142,7 +1145,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); @@ -1155,10 +1159,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 671bd07b69e..f2d23944b74 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -173,13 +173,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 @@ -264,7 +271,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; @@ -275,7 +282,7 @@ 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; @@ -342,7 +349,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; @@ -352,7 +359,8 @@ 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; }; @@ -404,8 +412,10 @@ struct uiBlock { short alignnr; 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[6]; double auto_open_last; @@ -413,32 +423,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 color_profile; /* color profile for correcting linear colors for display */ - 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 4324e050cec..48cecc96e73 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1086,7 +1086,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, ""); @@ -1095,7 +1096,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 { @@ -1812,7 +1814,8 @@ void ui_but_add_search(uiBut *but, PointerRNA *ptr, PropertyRNA *prop, PointerRN UI_but_func_search_set(but, ui_searchbox_create_generic, rna_search_cb, but, NULL, NULL); } 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; } } @@ -1953,7 +1956,8 @@ static uiBut *ui_item_menu( UI_block_emboss_set(block, UI_EMBOSS); } 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); } diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 56f95cd929c..18b6e33cbf7 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -461,7 +461,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 8332ab77bb2..b146134e88b 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> @@ -1619,8 +1620,10 @@ void UI_panel_category_draw_all(ARegion *ar, const char *category_id_active) const int px = max_ii(1, round_fl_to_int(U.pixelsize)); 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; const int roundboxtype = UI_CNR_TOP_LEFT | UI_CNR_BOTTOM_LEFT; bool is_alpha; @@ -1873,7 +1876,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; } } @@ -1940,10 +1944,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 f1079957592..42d197100fa 100644 --- a/source/blender/editors/interface/interface_region_color_picker.c +++ b/source/blender/editors/interface/interface_region_color_picker.c @@ -155,7 +155,8 @@ static void ui_update_color_picker_buts_rgb( if (block->color_profile) display = ui_block_cm_display_get(block); - /* 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; diff --git a/source/blender/editors/interface/interface_region_menu_pie.c b/source/blender/editors/interface/interface_region_menu_pie.c index ef2d273bab6..0e5634db7b1 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 fac96fc2154..7a0775dd87a 100644 --- a/source/blender/editors/interface/interface_region_menu_popup.c +++ b/source/blender/editors/interface/interface_region_menu_popup.c @@ -388,7 +388,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 */ diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c index 8d4389c73e6..c7b41ebe5d9 100644 --- a/source/blender/editors/interface/interface_region_search.c +++ b/source/blender/editors/interface/interface_region_search.c @@ -89,10 +89,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; @@ -261,7 +265,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 5991d99d980..519c798cba1 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -510,7 +510,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 f9fcf9520be..636f0e1fdd2 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -813,7 +813,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); @@ -831,14 +833,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); } @@ -874,7 +882,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 *************************/ @@ -912,7 +921,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 */ @@ -1040,7 +1050,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) || STREQ(scene->r.engine, RE_engine_id_BLENDER_GAME))) @@ -2205,7 +2216,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, RNAUpdateCb *cb) @@ -2969,7 +2981,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; @@ -3595,7 +3608,8 @@ void 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; @@ -4024,7 +4038,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_widgets.c b/source/blender/editors/interface/interface_widgets.c index 5aa56dda0ff..0db04842a1a 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -355,7 +355,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 = ( @@ -1032,7 +1033,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]); @@ -1261,7 +1263,8 @@ static void ui_text_clip_right_label(uiFontStyle *fstyle, uiBut *but, const rcti 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; @@ -2082,7 +2085,8 @@ static void widget_state(uiWidgetType *wt, int state) static void widget_state_numslider(uiWidgetType *wt, int state) { 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); @@ -3871,7 +3875,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... */ diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 9681d771521..c4cd6d2b656 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -226,7 +226,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 eebe0f6dfe6..d1ba88e717f 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -220,7 +220,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; @@ -275,7 +276,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 */ @@ -308,7 +310,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; @@ -343,7 +346,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; } @@ -358,7 +362,8 @@ void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy) view2d_masks(v2d, 0); /* 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 @@ -467,7 +472,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]); } @@ -557,7 +563,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; @@ -656,7 +663,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; @@ -706,7 +714,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; @@ -784,7 +793,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; @@ -973,7 +983,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); } @@ -1053,7 +1064,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); @@ -1090,7 +1102,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); @@ -1129,7 +1142,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 */ @@ -1189,7 +1203,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 */ @@ -1675,7 +1691,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... */ @@ -1798,7 +1815,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; } @@ -1867,7 +1885,8 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v UI_ThemeColor(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 e08f9535e1f..5e8ad98f4bf 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -76,19 +76,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 */ @@ -260,7 +269,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; @@ -672,7 +682,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 */ @@ -705,7 +716,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 */ @@ -1032,7 +1044,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; @@ -1085,7 +1098,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; @@ -1131,7 +1145,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; @@ -1260,7 +1275,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); @@ -1477,7 +1493,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; } @@ -1573,20 +1590,31 @@ 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 */ - - short 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?) - - 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 */ - - float scrollbarwidth; /* width of the scrollbar itself, used for page up/down clicks */ - int scrollbar_orig; /* initial location of scrollbar x/y, mouse relative */ + /** View2D data that this operation affects */ + View2D *v2d; + /** region that the scroller is in */ + ARegion *ar; - int lastx, lasty; /* previous mouse coordinates (in screen coordinates) for determining movement */ + /** scroller that mouse is in ('h' or 'v') */ + short scroller; + /* 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; + + /** 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; + + /** width of the scrollbar itself, used for page up/down clicks */ + float scrollbarwidth; + /** initial location of scrollbar x/y, mouse relative */ + int scrollbar_orig; + + /** previous mouse coordinates (in screen coordinates) for determining movement */ + int lastx, lasty; } v2dScrollerMove; @@ -1694,8 +1722,8 @@ static void scroller_activate_init(bContext *C, wmOperator *op, const wmEvent *e */ scrollers = UI_view2d_scrollers_calc(C, v2d, 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); @@ -1841,10 +1869,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; } @@ -1852,10 +1882,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; } @@ -1897,7 +1929,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); @@ -1907,7 +1940,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent * /* check if mouse in scrollbars, if they're enabled */ in_scroller = UI_view2d_mouse_in_scrollers(C, 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; @@ -1918,10 +1952,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; } @@ -1978,7 +2014,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/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 407c19a3860..4d15dbbd6ae 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -677,14 +677,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; diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index cf67a9715a8..38b39cb463a 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -2215,7 +2215,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/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index e49c0132762..a752b5d6206 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -80,7 +80,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; /* modal only */ @@ -166,7 +167,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 54799e3813f..339c928709f 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -213,7 +213,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 86b1a58dd1e..11c4f1239a7 100644 --- a/source/blender/editors/mesh/editmesh_intersect.c +++ b/source/blender/editors/mesh/editmesh_intersect.c @@ -610,8 +610,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) { diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 0b3c4dbc982..2e4ee919af9 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -2071,7 +2071,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; @@ -3116,7 +3117,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 34951a24805..8124ca35463 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -461,10 +461,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); WM_event_add_notifier(C, NC_GEOM | ND_SELECT, lcd->ob->data); @@ -848,7 +851,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 eccc15bf83f..1e55630813f 100644 --- a/source/blender/editors/mesh/editmesh_path.c +++ b/source/blender/editors/mesh/editmesh_path.c @@ -66,7 +66,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 f23f0ae5fab..9570578a955 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -312,7 +312,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); @@ -798,7 +799,8 @@ static int edbm_rip_invoke__vert(bContext *C, wmOperator *op, const wmEvent *eve 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 1edfcae6c02..a1e9812c411 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -197,7 +197,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 border select and circle select */ static BLI_bitmap *selbuf = NULL; @@ -2044,7 +2045,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 c0f73d1d23a..7a7452f1e2b 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -144,7 +144,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); @@ -2946,8 +2947,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; @@ -3074,7 +3077,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) { @@ -4933,7 +4937,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"); @@ -5074,9 +5079,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; diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index 60aa410a665..15e388658c5 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -801,7 +801,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; @@ -820,7 +821,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; @@ -1230,7 +1232,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 1615ec75565..68bee0ce5eb 100644 --- a/source/blender/editors/mesh/mesh_mirror.c +++ b/source/blender/editors/mesh/mesh_mirror.c @@ -313,7 +313,8 @@ void ED_mesh_mirrtopo_init(Mesh *me, DerivedMesh *dm, const int ob_mode, MirrTop 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 311f13b3ef7..c25b41e737b 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -144,7 +144,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); @@ -391,7 +392,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 <= base->object->totcol; a++) { ma = give_current_material(base->object, a); @@ -414,7 +416,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__); @@ -445,7 +448,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]; } } @@ -479,8 +483,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( bmain, scene, diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 1bba15c93c1..c15fa68e310 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1404,8 +1404,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; } diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 70d3d856599..5419eaf9606 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -103,7 +103,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) @@ -1270,7 +1271,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 */ DAG_relations_tag_update(CTX_data_main(C)); @@ -1599,7 +1601,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 91081345069..64a0ae53fbb 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -69,7 +69,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 b4e17ce3528..173621b3846 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -473,8 +473,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(bmain, &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); diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index d27edb5a9e4..29f85548b1b 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -499,7 +499,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 */ @@ -508,14 +509,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; } @@ -1567,7 +1570,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); } DAG_id_tag_update(&ob_dst->id, OB_RECALC_DATA); break; @@ -1960,7 +1964,8 @@ static void single_mat_users(Main *bmain, Scene *scene, const int flag, const bo 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); diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index e11782cd4b3..ce3ba15c58c 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -957,7 +957,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; } @@ -1960,20 +1962,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 181c42a4072..edd3977ea58 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -3149,7 +3149,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; @@ -3233,7 +3236,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 e6b8ac596e9..1e66b050828 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -629,7 +629,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"); } @@ -885,7 +886,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 d94776d126f..ca81b549731 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -146,7 +146,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; @@ -649,8 +650,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 78cedf099a1..db840751238 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -670,7 +670,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 8aa345dfa10..a0c5a14c80b 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1732,7 +1732,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)) @@ -1886,7 +1887,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/screendump.c b/source/blender/editors/screen/screendump.c index 3ec2078a4d1..98ac33d1e7a 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 90066a20e88..77a43dec23d 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -314,8 +314,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, @@ -787,7 +789,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(); /* save lots of GL state @@ -1039,8 +1042,9 @@ static void paint_draw_cursor(bContext *C, int x, int y, void *UNUSED(unused)) outline_col = brush->add_col; 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 59a5a87626c..c6e519d3245 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -375,11 +375,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); + } } } @@ -1065,7 +1068,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 c5bd88d8047..c1b34919a24 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -1520,7 +1520,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 bfde868c241..bbbfb3eb5e1 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -169,7 +169,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) @@ -407,7 +408,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; @@ -635,7 +637,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) @@ -795,7 +798,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]) @@ -1366,8 +1370,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; @@ -1715,7 +1721,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); @@ -1743,7 +1750,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); @@ -2120,7 +2128,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) @@ -2154,7 +2163,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; @@ -2202,7 +2212,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); @@ -2680,7 +2691,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; } @@ -2799,15 +2811,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); @@ -2827,20 +2841,23 @@ static void project_paint_face_init( if (ps->do_mask_normal || ps->dm_mloopuv_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); @@ -2863,13 +2880,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; } @@ -2979,13 +2998,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]; @@ -3069,7 +3089,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; } @@ -3385,7 +3406,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; } } @@ -3395,7 +3417,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; } } @@ -3786,7 +3809,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++; @@ -4519,7 +4543,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)) { @@ -5069,7 +5094,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); @@ -5546,7 +5572,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 e0fdcc0c7c8..10ef43a6007 100644 --- a/source/blender/editors/sculpt_paint/paint_mask.c +++ b/source/blender/editors/sculpt_paint/paint_mask.c @@ -486,7 +486,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 1bfa0bef2f2..cd855e21704 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.c +++ b/source/blender/editors/sculpt_paint/paint_stroke.c @@ -461,8 +461,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) || @@ -947,7 +950,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 eb96425ee5b..fff202088f8 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -789,7 +789,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); @@ -2071,7 +2072,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) { @@ -2090,7 +2092,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; @@ -2742,7 +2745,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]; @@ -2839,7 +2843,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]; @@ -2854,7 +2859,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); @@ -2878,7 +2884,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]; @@ -3019,7 +3026,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) { @@ -3038,7 +3046,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 28f5c1304c8..2bb4b7091d6 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c @@ -210,7 +210,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); @@ -225,7 +226,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); } @@ -372,7 +374,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 c70aabb2d80..a50db002ffc 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -106,7 +106,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; @@ -2453,7 +2454,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); @@ -3951,7 +3953,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]; @@ -4343,7 +4346,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); } } @@ -4795,8 +4799,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 @@ -4914,7 +4920,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])) { @@ -5159,7 +5166,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 a1514a65694..66b19aaeab2 100644 --- a/source/blender/editors/sculpt_paint/sculpt_uv.c +++ b/source/blender/editors/sculpt_paint/sculpt_uv.c @@ -84,7 +84,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 832505c2281..5d39bcb77c0 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -814,7 +814,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 8d4596a79a7..0976d0a8447 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 289cf730228..8a74098dabe 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -325,7 +325,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 */ @@ -535,8 +536,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); @@ -681,8 +683,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); @@ -819,10 +825,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 */ @@ -887,10 +895,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 */ @@ -1574,10 +1584,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 */ @@ -1697,10 +1709,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 581725b7030..cd344222fbc 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -94,10 +94,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); @@ -1053,10 +1055,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 */ @@ -1245,7 +1249,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 */ @@ -1265,10 +1270,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) { @@ -1366,8 +1373,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); @@ -1440,7 +1450,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 58c43b386e3..9a7ec141ae7 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -424,7 +424,8 @@ static void action_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn) 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)) || @@ -432,7 +433,8 @@ static void action_listener(bScreen *UNUSED(sc), ScrArea *sa, wmNotifier *wmn) { 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 { @@ -454,7 +456,8 @@ static void action_listener(bScreen *UNUSED(sc), 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: 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 f5e0ccb60c7..db7878872b1 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -766,7 +766,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")) { @@ -1146,7 +1147,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->draw = buttons_panel_context; pt->flag = PNL_NO_HEADER; diff --git a/source/blender/editors/space_clip/clip_buttons.c b/source/blender/editors/space_clip/clip_buttons.c index ce97d87d0c4..0652f878dc0 100644 --- a/source/blender/editors/space_clip/clip_buttons.c +++ b/source/blender/editors/space_clip/clip_buttons.c @@ -183,19 +183,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 4bf4c1e7baa..984cbd5c44e 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.c +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.c @@ -303,7 +303,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_graph_ops.c b/source/blender/editors/space_clip/clip_graph_ops.c index 2c6aad36b2a..9f49ae86c84 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.c +++ b/source/blender/editors/space_clip/clip_graph_ops.c @@ -239,7 +239,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 763bb1bcc88..39a02e7dd05 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -850,9 +850,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)) { - 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 f407d82aa5e..619483789d8 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -304,7 +304,8 @@ static void file_draw_string(int sx, int sy, const char *string, float width, in 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 429b643a807..a3ec64deb64 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_border_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_toggle(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 368fc8be35c..7627d37d767 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -166,7 +166,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; @@ -209,19 +210,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. */ @@ -236,7 +242,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; @@ -911,7 +918,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; } } @@ -1003,7 +1011,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; @@ -1349,7 +1358,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) { @@ -1562,7 +1572,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]; @@ -1603,7 +1614,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; @@ -1724,8 +1736,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); @@ -1738,7 +1751,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; @@ -1755,7 +1770,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) { @@ -1772,7 +1788,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; @@ -1803,7 +1820,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; @@ -1900,11 +1918,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); @@ -1922,7 +1942,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; } @@ -1965,7 +1986,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)) { @@ -2269,7 +2291,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); @@ -2312,7 +2335,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) { @@ -2386,7 +2410,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++; @@ -2500,10 +2525,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); @@ -2522,13 +2548,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. */ @@ -2569,7 +2597,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); @@ -2602,7 +2631,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 1c86ecc327b..fac4c1235df 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -626,7 +626,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 359cce45baa..24560d54f63 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 d3f3a4e3395..a12cb7034ad 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -681,7 +681,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 */ @@ -696,7 +698,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); } @@ -883,14 +887,22 @@ static void graph_panel_drivers(const bContext *C, Panel *pa) 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); diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 2cbbeda4abf..82467a8c7b3 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -272,7 +272,8 @@ static void draw_fcurve_vertices(SpaceIpo *sipo, ARegion *ar, FCurve *fcu, short glPointSize(UI_GetThemeValuef(TH_VERTEX_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) { set_fcurve_vertex_color(fcu, 0); draw_fcurve_vertices_handles(fcu, sipo, v2d, 0, sel_handle_only, units_scale); @@ -294,13 +295,20 @@ static void draw_fcurve_vertices(SpaceIpo *sipo, ARegion *ar, FCurve *fcu, short 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 0; @@ -503,7 +511,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); @@ -705,7 +714,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]; glVertex2fv(v1); @@ -725,7 +735,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 cd00959e7d2..647d39646bb 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -277,7 +277,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; @@ -296,7 +297,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; @@ -1796,9 +1798,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) @@ -1859,7 +1864,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; } @@ -1879,7 +1885,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, @@ -1912,7 +1919,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 aa1d0511e3d..cce99d8a81e 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -82,7 +82,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 da44c33104c..47656d78dd2 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1406,7 +1406,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); @@ -1416,7 +1417,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 3b476ff3645..43add0e64b4 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -337,7 +337,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; @@ -467,7 +470,8 @@ static void graph_listener(bScreen *UNUSED(sc), 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 @@ -475,7 +479,8 @@ static void graph_listener(bScreen *UNUSED(sc), 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); @@ -488,7 +493,8 @@ static void graph_listener(bScreen *UNUSED(sc), 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); @@ -746,7 +752,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->init = graph_channel_region_init; diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 26bd560b31f..4e6ad8aa268 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 b6e51ab4655..3c0f1ffdd53 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1508,7 +1508,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 ********************/ @@ -1637,7 +1638,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; } @@ -1657,7 +1659,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)); @@ -2621,13 +2624,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); } @@ -2877,7 +2883,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 fd661883f79..5e893bfb906 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -376,9 +376,12 @@ static void image_keymap(struct wmKeyConfig *keyconf) /* dropboxes */ static bool image_drop_poll(bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event)) { - 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; } @@ -500,7 +503,8 @@ static void image_listener(bScreen *sc, ScrArea *sa, wmNotifier *wmn) 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 334106ff08d..a162d97a996 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -55,13 +55,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 63eb0e361bf..5b121892921 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -155,7 +155,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 103b0664a23..08f0c65344d 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -64,7 +64,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 @@ -256,7 +257,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); @@ -601,7 +603,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; added = true; diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index ea35c583913..5fa7a6dff31 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -91,7 +91,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; } @@ -349,7 +350,8 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri glEnable(GL_BLEND); 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 @@ -422,7 +424,8 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri nla_draw_strip_curves(strip, yminc, ymaxc); - /* 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); @@ -461,7 +464,8 @@ static void nla_draw_strip(SpaceNla *snla, AnimData *adt, NlaTrack *nlt, NlaStri fdrawline(repeatPos, yminc + 4, repeatPos, ymaxc - 4); } } - /* 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)) { NlaStrip *cs; float y = (ymaxc - yminc) / 2.0f + yminc; @@ -712,7 +716,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 5cf3ace747b..2d5c5d7af10 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -407,7 +407,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 */ @@ -469,7 +470,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); } @@ -569,7 +571,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 */ @@ -603,7 +606,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 " @@ -628,7 +632,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; @@ -1059,7 +1064,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); - /* 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 @@ -1538,7 +1544,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 */ @@ -1549,7 +1556,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); @@ -1662,7 +1670,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); } @@ -1736,7 +1745,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); } @@ -1969,21 +1979,25 @@ 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; } - /* 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); @@ -2047,7 +2061,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; @@ -2189,7 +2204,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 c1d62a9768d..72835084544 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -522,7 +522,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); @@ -549,14 +550,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 0dc057e754b..15e4b187e18 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -198,7 +198,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) { @@ -397,7 +398,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_ThemeColorBlendShade(TH_TEXT, color_id, 0.4f, 10); @@ -699,7 +701,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 */ @@ -1894,7 +1897,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); @@ -2974,7 +2978,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) { @@ -3125,7 +3129,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; diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 9a7d913f24e..a206144e297 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -188,7 +188,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) @@ -938,8 +939,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), @@ -1095,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 ad3a1a37f7a..3e6564b696f 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -2009,7 +2009,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 a3294211ff9..d9df6f6f81b 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -256,7 +256,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 */ @@ -305,7 +306,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);*/ } } } @@ -333,7 +336,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); */ } } } diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 9b396aa9642..2f13622f1fd 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 efdec512cf7..dfbd86c68b7 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 6995744f235..3ec04423e51 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -512,7 +512,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_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 3f3e3c89103..5650919baf9 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -1860,7 +1860,8 @@ void draw_outliner(const bContext *C) sizex = sizex_rna + OL_RNA_COL_SIZEX + 50; } 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 51117eef1dc..91e25a3528d 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -434,7 +434,8 @@ static int outliner_id_remap_exec(bContext *C, wmOperator *op) /* recreate dependency graph to include new objects */ DAG_scene_relations_rebuild(bmain, scene); - /* 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); @@ -653,7 +654,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_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 9c21241cf7b..3461842129e 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -773,7 +773,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 ebd6904fa56..cb762d8c0d5 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -1635,7 +1635,8 @@ void outliner_build_tree(Main *mainvar, Scene *scene, SpaceOops *soops) Base *base; 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_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 386e66a63e0..ebb172e9712 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 915e2466d54..1a7eb534a02 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1534,7 +1534,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) { @@ -1554,7 +1555,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 0f382ad0270..6144c5273be 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -400,9 +400,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; @@ -2422,7 +2424,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 1a9ef7970a4..944576a1953 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -350,7 +350,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 9a3dcddf804..094e95e552c 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -559,13 +559,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 */ @@ -812,7 +820,8 @@ static void calc_text_rcts(SpaceText *st, ARegion *ar, rcti *scroll, rcti *back) scroll->ymin = 4; scroll->ymax = 4 + 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 c483aa180db..fd5256ea6b8 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; @@ -2142,7 +2143,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; } @@ -2468,7 +2470,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; } @@ -2528,7 +2531,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 bf3f1d0dfb3..0780c932f4a 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -103,7 +103,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/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 2628e30a7ac..0da28be05a7 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1262,7 +1262,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); @@ -1414,7 +1415,8 @@ static void view3d_id_remap(ScrArea *sa, SpaceLink *slink, ID *old_id, ID *new_i 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 05e9a34f492..40ff685d50d 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -685,7 +685,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float apply_raw_diff(&bezt->alfa, tot, ve_median[C_TILT], median[C_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[LOC_X], &median[LOC_X]); } diff --git a/source/blender/editors/space_view3d/view3d_camera_control.c b/source/blender/editors/space_view3d/view3d_camera_control.c index 5c544ed24df..693c6396430 100644 --- a/source/blender/editors/space_view3d/view3d_camera_control.c +++ b/source/blender/editors/space_view3d/view3d_camera_control.c @@ -216,7 +216,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; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 40026a452a6..e5efe578b2a 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -447,8 +447,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; @@ -459,7 +459,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); @@ -1219,7 +1220,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; } @@ -3103,7 +3105,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)) { Scene *scene = CTX_data_scene(C); float xfac, yfac; @@ -3154,7 +3156,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); @@ -4597,7 +4599,8 @@ void ED_view3d_cursor3d_update(bContext *C, const int mval[2]) } } 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 175dab28cbe..3a66bef7fc2 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -86,11 +86,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; @@ -566,7 +567,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; @@ -590,7 +592,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; @@ -610,7 +613,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 { @@ -729,14 +733,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 { @@ -798,7 +805,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 @@ -888,7 +898,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_project.c b/source/blender/editors/space_view3d/view3d_project.c index 20f3feb28ac..dde5c586c4c 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -117,9 +117,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 d8c21da48a4..ce53007a63a 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -984,7 +984,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_base_object_activate(C, base); ED_base_object_select(base, BA_SELECT); @@ -1401,7 +1402,9 @@ static bool ed_object_select_pick( startbase = FIRSTBASE; if (BASACT && BASACT->next) startbase = BASACT->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) { @@ -1472,7 +1475,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; diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index 90da960ada8..20820e9d766 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -76,7 +76,8 @@ float *ED_view3d_cursor3d_get(Scene *scene, View3D *v3d) 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; } @@ -411,7 +412,8 @@ bool ED_view3d_persp_ensure(struct 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(v3d, rv3d, persp); } @@ -1102,7 +1104,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 cfd506caf6e..1f93923375e 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 */ @@ -238,8 +240,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! */ @@ -251,7 +253,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 b2846a630d2..276deb5fb0d 100644 --- a/source/blender/editors/space_view3d/view3d_walk.c +++ b/source/blender/editors/space_view3d/view3d_walk.c @@ -981,8 +981,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 e3b09068ea9..84da72ef045 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -362,7 +362,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; } } @@ -990,7 +991,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) { @@ -1807,7 +1809,8 @@ static void drawTransformView(const struct bContext *C, ARegion *UNUSED(ar), voi drawVertSlide(t); } -/* 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; @@ -2139,9 +2142,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); @@ -3896,7 +3903,7 @@ static void ElementRotation_ex(TransInfo *t, TransData *td, float mat[3][3], con 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); @@ -5563,9 +5570,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))) @@ -6403,7 +6413,9 @@ static bool createEdgeSlideVerts_double_side(TransInfo *t, bool use_even, bool f 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. */ @@ -7941,7 +7953,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 a25ed90973b..01283b9fa8c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -915,14 +915,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 */ @@ -943,7 +945,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 */ @@ -953,7 +958,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 { @@ -1014,7 +1022,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) { @@ -2286,7 +2295,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); @@ -2816,11 +2826,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]); @@ -2830,12 +2844,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; } @@ -2862,8 +2880,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] */ @@ -3382,7 +3400,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 */ @@ -3799,7 +3818,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); @@ -4448,7 +4468,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; @@ -4552,7 +4573,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; @@ -4811,7 +4833,9 @@ void flushTransGraphData(TransInfo *t) a < t->total; 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 @@ -5229,8 +5253,8 @@ static void freeSeqData(TransInfo *t, TransCustomData *custom_data) } } 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; } @@ -5503,7 +5527,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 */ @@ -6323,9 +6348,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)) ) @@ -6354,9 +6381,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))) @@ -6367,9 +6396,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))) @@ -6455,9 +6486,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))) @@ -6601,8 +6634,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t) /* flag object caches as outdated */ BKE_ptcache_ids_from_object(bmain, &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); @@ -8219,7 +8254,8 @@ void createTransData(bContext *C, TransInfo *t) if (t->data && (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); } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index b28958dfe3f..08cd168797a 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -264,7 +264,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); @@ -552,7 +553,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); @@ -560,7 +562,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 diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index b60c8bf47f6..b4f2679fe9b 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -182,7 +182,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 7120158ab46..779b7cfc028 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -403,7 +403,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); } diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index b61960997b1..df689cc83aa 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -135,7 +135,8 @@ void ED_editors_exit(bContext *C) /* frees all editmode undos */ if (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; @@ -181,7 +182,8 @@ bool ED_editors_flush_edits(const bContext *C, 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 f25bc6350c1..e80932e20e7 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -49,7 +49,9 @@ #include "UI_interface.h" -/* 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. */ @@ -126,7 +128,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); } @@ -147,7 +150,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])); } } @@ -294,7 +298,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: @@ -309,7 +314,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]) { @@ -361,7 +367,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; @@ -475,7 +482,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]; double val; @@ -516,7 +524,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 f9c5dd89179..f7d3dab576a 100644 --- a/source/blender/editors/uvedit/uvedit_buttons.c +++ b/source/blender/editors/uvedit/uvedit_buttons.c @@ -236,7 +236,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_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index c0378f967ad..d3157f730a6 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2172,7 +2172,9 @@ static int uv_mouse_select(bContext *C, const float co[2], bool extend, bool loo 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; const int cd_loop_uv_offset = CustomData_get_offset(&em->bm->ldata, CD_MLOOPUV); diff --git a/source/blender/editors/uvedit/uvedit_parametrizer.c b/source/blender/editors/uvedit/uvedit_parametrizer.c index 412d68a5d4d..7a9e4960bee 100644 --- a/source/blender/editors/uvedit/uvedit_parametrizer.c +++ b/source/blender/editors/uvedit/uvedit_parametrizer.c @@ -4546,7 +4546,8 @@ void param_pack(ParamHandle *handle, float margin, bool do_rotate) 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 869009d1bdf..75247c59fb4 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -84,7 +84,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 */ @@ -129,16 +130,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; @@ -525,8 +529,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]; @@ -714,7 +719,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; } } @@ -1047,7 +1053,8 @@ static int stitch_process_data(StitchState *state, Scene *scene, int final) /* 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) { @@ -1705,7 +1712,8 @@ static int stitch_init(bContext *C, wmOperator *op) } } - /* 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"); diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index b94ddf1ef52..a7d5b663980 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -377,7 +377,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; |