[Bf-blender-cvs] [84f025c6fdb] master: Cleanup: use sentences for pose slide comments
Campbell Barton
noreply at git.blender.org
Fri Jun 11 08:29:12 CEST 2021
Commit: 84f025c6fdba38a1cdf8e3070c9642977837cb33
Author: Campbell Barton
Date: Fri Jun 11 16:27:55 2021 +1000
Branches: master
https://developer.blender.org/rB84f025c6fdba38a1cdf8e3070c9642977837cb33
Cleanup: use sentences for pose slide comments
===================================================================
M source/blender/editors/armature/pose_slide.c
===================================================================
diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c
index e41a44a3c12..2f5d2f6c12d 100644
--- a/source/blender/editors/armature/pose_slide.c
+++ b/source/blender/editors/armature/pose_slide.c
@@ -19,6 +19,28 @@
/** \file
* \ingroup edarmature
+ *
+ * Pose 'Sliding' Tools
+ * ====================
+ *
+ * - Push & Relax, Breakdowner
+
+ * These tools provide the animator with various capabilities
+ * for interactively controlling the spacing of poses, but also
+ * for 'pushing' and/or 'relaxing' extremes as they see fit.
+ *
+ * - Propagate
+
+ * This tool copies elements of the selected pose to successive
+ * keyframes, allowing the animator to go back and modify the poses
+ * for some "static" pose controls, without having to repeatedly
+ * doing a "next paste" dance.
+ *
+ * - Pose Sculpting (TODO)
+
+ * This is yet to be implemented, but the idea here is to use
+ * sculpting techniques to make it easier to pose rigs by allowing
+ * rigs to be manipulated using a familiar paint-based interface.
*/
#include "MEM_guardedalloc.h"
@@ -74,45 +96,29 @@
#define SLIDE_PIXEL_DISTANCE (300 * U.pixelsize)
#define OVERSHOOT_RANGE_DELTA 0.2f
-/* **************************************************** */
-/* == POSE 'SLIDING' TOOLS ==
- *
- * A) Push & Relax, Breakdowner
- * These tools provide the animator with various capabilities
- * for interactively controlling the spacing of poses, but also
- * for 'pushing' and/or 'relaxing' extremes as they see fit.
- *
- * B) Propagate
- * This tool copies elements of the selected pose to successive
- * keyframes, allowing the animator to go back and modify the poses
- * for some "static" pose controls, without having to repeatedly
- * doing a "next paste" dance.
- *
- * C) Pose Sculpting
- * This is yet to be implemented, but the idea here is to use
- * sculpting techniques to make it easier to pose rigs by allowing
- * rigs to be manipulated using a familiar paint-based interface.
- */
/* **************************************************** */
/* A) Push & Relax, Breakdowner */
-/* Axis Locks */
+/** Axis Locks. */
typedef enum ePoseSlide_AxisLock {
PS_LOCK_X = (1 << 0),
PS_LOCK_Y = (1 << 1),
PS_LOCK_Z = (1 << 2),
} ePoseSlide_AxisLock;
-/* Pose Sliding Modes */
+/** Pose Sliding Modes. */
typedef enum ePoseSlide_Modes {
- POSESLIDE_PUSH = 0, /* exaggerate the pose... */
- POSESLIDE_RELAX, /* soften the pose... */
- POSESLIDE_BREAKDOWN, /* slide between the endpoint poses, finding a 'soft' spot */
+ /** Exaggerate the pose. */
+ POSESLIDE_PUSH = 0,
+ /** soften the pose. */
+ POSESLIDE_RELAX,
+ /** Slide between the endpoint poses, finding a 'soft' spot. */
+ POSESLIDE_BREAKDOWN,
POSESLIDE_PUSH_REST,
POSESLIDE_RELAX_REST,
} ePoseSlide_Modes;
-/* Transforms/Channels to Affect */
+/** Transforms/Channels to Affect. */
typedef enum ePoseSlide_Channels {
PS_TFM_ALL = 0, /* All transforms and properties */
@@ -125,7 +131,7 @@ typedef enum ePoseSlide_Channels {
PS_TFM_PROPS, /* Custom Properties */
} ePoseSlide_Channels;
-/* Temporary data shared between these operators */
+/** Temporary data shared between these operators. */
typedef struct tPoseSlideOp {
/** current scene */
Scene *scene;
@@ -162,41 +168,44 @@ typedef struct tPoseSlideOp {
/** Axis-limits for transforms. */
ePoseSlide_AxisLock axislock;
- /* Allow overshoot or clamp between 0% and 100%. */
+ /** Allow overshoot or clamp between 0% and 100%. */
bool overshoot;
- /* Reduces factor delta from mouse movement. */
+ /** Reduces factor delta from mouse movement. */
bool precision;
- /* Move factor in 10% steps. */
+ /** Move factor in 10% steps. */
bool increments;
- /* Draw callback handler. */
+ /** Draw callback handler. */
void *draw_handle;
- /* Accumulative, unclamped and unrounded factor. */
+ /** Accumulative, unclamped and unrounded factor. */
float raw_factor;
- /* 0-1 value for determining the influence of whatever is relevant. */
+ /** 0-1 value for determining the influence of whatever is relevant. */
float factor;
- /* Last cursor position in screen space used for mouse movement delta calculation. */
+ /** Last cursor position in screen space used for mouse movement delta calculation. */
int last_cursor_x;
- /* Numeric input. */
+ /** Numeric input. */
NumInput num;
struct tPoseSlideObject *ob_data_array;
} tPoseSlideOp;
typedef struct tPoseSlideObject {
- Object *ob; /* active object that Pose Info comes from */
- 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) */
+ /** Active object that Pose Info comes from. */
+ Object *ob;
+ /** `prevFrame`, but in local action time (for F-Curve look-ups to work). */
+ float prevFrameF;
+ /** `nextFrame`, but in local action time (for F-Curve look-ups to work). */
+ float nextFrameF;
bool valid;
} tPoseSlideObject;
-/* Property enum for ePoseSlide_Channels */
+/** Property enum for #ePoseSlide_Channels. */
static const EnumPropertyItem prop_channels_types[] = {
{PS_TFM_ALL,
"ALL",
@@ -363,7 +372,9 @@ static void draw_backdrop(const int fontid,
UI_draw_roundbox_aa(&backdrop_rect, true, 4.0f, color_bg);
}
-/* Draw an on screen Slider for a Pose Slide Operator. */
+/**
+ * Draw an on screen Slider for a Pose Slide Operator.
+ */
static void pose_slide_draw_2d_slider(const struct bContext *UNUSED(C), ARegion *region, void *arg)
{
tPoseSlideOp *pso = arg;
@@ -471,34 +482,34 @@ static void pose_slide_draw_2d_slider(const struct bContext *UNUSED(C), ARegion
BLF_draw(fontid, percentage_string, sizeof(percentage_string));
}
-/* operator init */
+/** Operator custom-data initialization. */
static int pose_slide_init(bContext *C, wmOperator *op, ePoseSlide_Modes mode)
{
tPoseSlideOp *pso;
- /* init slide-op data */
+ /* Init slide-op data. */
pso = op->customdata = MEM_callocN(sizeof(tPoseSlideOp), "tPoseSlideOp");
- /* get info from context */
+ /* Get info from context. */
pso->scene = CTX_data_scene(C);
- pso->area = CTX_wm_area(C); /* only really needed when doing modal() */
- pso->region_header = CTX_wm_region(C); /* only really needed when doing modal() */
+ pso->area = CTX_wm_area(C); /* Only really needed when doing modal(). */
+ pso->region_header = CTX_wm_region(C); /* Only really needed when doing modal(). */
pso->cframe = pso->scene->r.cfra;
pso->mode = mode;
- /* set range info from property values - these may get overridden for the invoke() */
+ /* Set range info from property values - these may get overridden for the invoke(). */
pso->factor = RNA_float_get(op->ptr, "factor");
pso->raw_factor = pso->factor;
pso->prevFrame = RNA_int_get(op->ptr, "prev_frame");
pso->nextFrame = RNA_int_get(op->ptr, "next_frame");
- /* get the set of properties/axes that can be operated on */
+ /* Get the set of properties/axes that can be operated on. */
pso->channels = RNA_enum_get(op->ptr, "channels");
pso->axislock = RNA_enum_get(op->ptr, "axis_lock");
- /* for each Pose-Channel which gets affected, get the F-Curves for that channel
- * and set the relevant transform flags... */
+ /* For each Pose-Channel which gets affected, get the F-Curves for that channel
+ * and set the relevant transform flags. */
poseAnim_mapping_get(C, &pso->pfLinks);
Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data(
@@ -518,29 +529,28 @@ static int pose_slide_init(bContext *C, wmOperator *op, ePoseSlide_Modes mode)
ob_data->ob = ob_iter;
ob_data->valid = true;
- /* apply NLA mapping corrections so the frame lookups work */
+ /* Apply NLA mapping corrections so the frame look-ups work. */
ob_data->prevFrameF = BKE_nla_tweakedit_remap(
ob_data->ob->adt, pso->prevFrame, NLATIME_CONVERT_UNMAP);
ob_data->nextFrameF = BKE_nla_tweakedit_remap(
ob_data->ob->adt, pso->nextFrame, NLATIME_CONVERT_UNMAP);
- /* set depsgraph flags */
- /* make sure the lock is set OK, unlock can be accidentally saved? */
+ /* Set depsgraph flags. */
+ /* Make sure the lock is set OK, unlock can be accidentally saved? */
ob_data->ob->pose->flag |= POSE_LOCKED;
ob_data->ob->pose->flag &= ~POSE_DO_UNLOCK;
}
MEM_freeN(objects);
- /* do basic initialize of RB-BST used for finding keyframes, but leave the filling of it up
- * to the caller of this (usually only invoke() will do it, to make things more efficient).
- */
+ /* Do basic initialize of RB-BST used for finding keyframes, but leave the filling of it up
+ * to the caller of this (usually only invoke() will do it, to make things more efficient). */
BLI_dlrbTree_init(&pso->keys);
/* Initialize numeric input. */
initNumInput(&pso->num);
- pso->num.idx_max = 0; /* one axis */
+ pso->num.idx_max = 0; /* One axis. */
pso->num.val_flag[0] |= NUM_NO_NEGATIVE;
- pso->num.unit_type[0] = B_UNIT_NONE; /* percentages don't have any units... */
+ pso->num.unit_type[0] = B_UNIT_NONE; /* Percentages don't have any units. */
/* Register UI drawing callback. */
ARegion *region_header = BKE_area_find_region_type(pso->area, RGN_TYPE_HEADER);
@@ -550,11 +560,13 @@ static int pose_slide_init(bContext *C, wmOperator *op, ePoseSlide_Modes mode)
region_header->type, pose_slide_draw_2d_slider, pso, REGION_DRAW_POST_PIXEL);
}
- /* return status is whether we've got all the data we were requested to get */
+ /* Return status is whether we've got all the data we were requested to get. */
return 1;
}
-/* exiting the operator - free data */
+/**
+ * Exiting the operator (free data).
+ */
static void pose_slide_exit(wmOperator *op)
{
tPoseSlideOp *pso = op->customdata;
@@ -566,32 +578,34 @@ static void pose_slide_exit(wmOperator *op)
/* Remove UI drawing callback. */
ED_region_draw_cb_exit(pso->region_header->type, pso->draw_handle);
- /* if data exists, clear its data and exit */
+ /* If data exists
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list