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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-26 03:54:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-26 03:54:33 +0400
commit09144c3756f7b9b23461b522cf9711eb1c8db775 (patch)
tree3a037e82f54a35c09a67dcb236b8029d62dfd504 /source/blender/editors/space_view3d/drawanimviz.c
parent1ce2c73816be97f72484ffa40a3187b24968c6b3 (diff)
style cleanup: mostly whitespace around operators
Diffstat (limited to 'source/blender/editors/space_view3d/drawanimviz.c')
-rw-r--r--source/blender/editors/space_view3d/drawanimviz.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c
index 545ec42e72f..d0e344ef0d5 100644
--- a/source/blender/editors/space_view3d/drawanimviz.c
+++ b/source/blender/editors/space_view3d/drawanimviz.c
@@ -70,7 +70,7 @@
/* Set up drawing environment for drawing motion paths */
void draw_motion_paths_init(View3D *v3d, ARegion *ar)
{
- RegionView3D *rv3d= ar->regiondata;
+ RegionView3D *rv3d = ar->regiondata;
if (v3d->zbuf) glDisable(GL_DEPTH_TEST);
@@ -79,15 +79,15 @@ void draw_motion_paths_init(View3D *v3d, ARegion *ar)
}
/* Draw the given motion path for an Object or a Bone
- * - assumes that the viewport has already been initialized properly
+ * - assumes that the viewport has already been initialized properly
* i.e. draw_motion_paths_init() has been called
*/
void draw_motion_path_instance(Scene *scene,
- Object *ob, bPoseChannel *pchan, bAnimVizSettings *avs, bMotionPath *mpath)
+ Object *ob, bPoseChannel *pchan, bAnimVizSettings *avs, bMotionPath *mpath)
{
//RegionView3D *rv3d= ar->regiondata;
bMotionPathVert *mpv, *mpv_start;
- int i, stepsize= avs->path_step;
+ int i, stepsize = avs->path_step;
int sfra, efra, len;
@@ -99,21 +99,21 @@ void draw_motion_path_instance(Scene *scene,
* the current frame to draw. However, this range is still
* restricted by the limits of the original path.
*/
- sfra= CFRA - avs->path_bc;
- efra= CFRA + avs->path_ac;
- if (sfra < mpath->start_frame) sfra= mpath->start_frame;
- if (efra > mpath->end_frame) efra= mpath->end_frame;
+ sfra = CFRA - avs->path_bc;
+ efra = CFRA + avs->path_ac;
+ if (sfra < mpath->start_frame) sfra = mpath->start_frame;
+ if (efra > mpath->end_frame) efra = mpath->end_frame;
- len= efra - sfra;
+ len = efra - sfra;
- sind= sfra - mpath->start_frame;
- mpv_start= (mpath->points + sind);
+ sind = sfra - mpath->start_frame;
+ mpv_start = (mpath->points + sind);
}
else {
- sfra= mpath->start_frame;
+ sfra = mpath->start_frame;
efra = sfra + mpath->length;
len = mpath->length;
- mpv_start= mpath->points;
+ mpv_start = mpath->points;
}
if (len <= 0) {
@@ -124,17 +124,17 @@ void draw_motion_path_instance(Scene *scene,
glShadeModel(GL_SMOOTH);
glBegin(GL_LINE_STRIP);
- for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
- short sel= (pchan) ? (pchan->bone->flag & BONE_SELECTED) : (ob->flag & SELECT);
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++) {
+ short sel = (pchan) ? (pchan->bone->flag & BONE_SELECTED) : (ob->flag & SELECT);
float intensity; /* how faint */
/* set color
- * - more intense for active/selected bones, less intense for unselected bones
- * - black for before current frame, green for current frame, blue for after current frame
- * - intensity decreases as distance from current frame increases
+ * - more intense for active/selected bones, less intense for unselected bones
+ * - black for before current frame, green for current frame, blue for after current frame
+ * - intensity decreases as distance from current frame increases
*/
- #define SET_INTENSITY(A, B, C, min, max) (((1.0f - ((C - B) / (C - A))) * (max-min)) + min)
- if ((sfra+i) < CFRA) {
+ #define SET_INTENSITY(A, B, C, min, max) (((1.0f - ((C - B) / (C - A))) * (max - min)) + min)
+ if ((sfra + i) < CFRA) {
/* black - before cfra */
if (sel) {
// intensity= 0.5f;
@@ -146,7 +146,7 @@ void draw_motion_path_instance(Scene *scene,
}
UI_ThemeColorBlend(TH_WIRE, TH_BACK, intensity);
}
- else if ((sfra+i) > CFRA) {
+ else if ((sfra + i) > CFRA) {
/* blue - after cfra */
if (sel) {
//intensity = 0.5f;
@@ -161,10 +161,10 @@ void draw_motion_path_instance(Scene *scene,
else {
/* green - on cfra */
if (sel) {
- intensity= 0.5f;
+ intensity = 0.5f;
}
else {
- intensity= 0.99f;
+ intensity = 0.99f;
}
UI_ThemeColorBlendShade(TH_CFRAME, TH_BACK, intensity, 10);
}
@@ -182,28 +182,28 @@ void draw_motion_path_instance(Scene *scene,
* NOTE: this is not really visible/noticeable
*/
glBegin(GL_POINTS);
- for (i=0, mpv=mpv_start; i < len; i++, mpv++)
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++)
glVertex3fv(mpv->co);
glEnd();
/* Draw little white dots at each framestep value */
UI_ThemeColor(TH_TEXT_HI);
glBegin(GL_POINTS);
- for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize)
+ for (i = 0, mpv = mpv_start; i < len; i += stepsize, mpv += stepsize)
glVertex3fv(mpv->co);
glEnd();
/* Draw big green dot where the current frame is */
// NOTE: only do this when drawing keyframes for now...
if ((avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) &&
- (sfra < CFRA) && (CFRA <= efra))
+ (sfra < CFRA) && (CFRA <= efra))
{
UI_ThemeColor(TH_CFRAME);
glPointSize(6.0f);
glBegin(GL_POINTS);
- mpv = mpv_start + (CFRA - sfra);
- glVertex3fv(mpv->co);
+ mpv = mpv_start + (CFRA - sfra);
+ glVertex3fv(mpv->co);
glEnd();
glPointSize(1.0f);
@@ -217,26 +217,26 @@ void draw_motion_path_instance(Scene *scene,
if (avs->path_viewflag & MOTIONPATH_VIEW_FNUMS) {
unsigned char col[4];
UI_GetThemeColor3ubv(TH_TEXT_HI, col);
- col[3]= 255;
+ col[3] = 255;
- for (i=0, mpv=mpv_start; i < len; i+=stepsize, mpv+=stepsize) {
+ for (i = 0, mpv = mpv_start; i < len; i += stepsize, mpv += stepsize) {
char numstr[32];
float co[3];
/* only draw framenum if several consecutive highlighted points don't occur on same point */
if (i == 0) {
- sprintf(numstr, "%d", (i+sfra));
+ sprintf(numstr, "%d", (i + sfra));
mul_v3_m4v3(co, ob->imat, mpv->co);
- view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col);
+ view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, col);
}
- else if ((i > stepsize) && (i < len-stepsize)) {
+ else if ((i > stepsize) && (i < len - stepsize)) {
bMotionPathVert *mpvP = (mpv - stepsize);
bMotionPathVert *mpvN = (mpv + stepsize);
- if ((equals_v3v3(mpv->co, mpvP->co)==0) || (equals_v3v3(mpv->co, mpvN->co)==0)) {
- sprintf(numstr, "%d", (sfra+i));
+ if ((equals_v3v3(mpv->co, mpvP->co) == 0) || (equals_v3v3(mpv->co, mpvN->co) == 0)) {
+ sprintf(numstr, "%d", (sfra + i));
mul_v3_m4v3(co, ob->imat, mpv->co);
- view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col);
+ view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, col);
}
}
}
@@ -246,7 +246,7 @@ void draw_motion_path_instance(Scene *scene,
if (avs->path_viewflag & MOTIONPATH_VIEW_KFRAS) {
unsigned char col[4];
- AnimData *adt= BKE_animdata_from_id(&ob->id);
+ AnimData *adt = BKE_animdata_from_id(&ob->id);
DLRBT_Tree keys;
/* build list of all keyframes in active action for object or pchan */
@@ -256,8 +256,8 @@ void draw_motion_path_instance(Scene *scene,
/* it is assumed that keyframes for bones are all grouped in a single group
* unless an option is set to always use the whole action
*/
- if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT)==0) {
- bActionGroup *agrp= action_groups_find_named(adt->action, pchan->name);
+ if ((pchan) && (avs->path_viewflag & MOTIONPATH_VIEW_KFACT) == 0) {
+ bActionGroup *agrp = action_groups_find_named(adt->action, pchan->name);
if (agrp) {
agroup_to_keylist(adt, agrp, &keys, NULL);
@@ -272,14 +272,14 @@ void draw_motion_path_instance(Scene *scene,
/* Draw slightly-larger yellow dots at each keyframe */
UI_GetThemeColor3ubv(TH_VERTEX_SELECT, col);
- col[3]= 255;
+ col[3] = 255;
glPointSize(4.0f); // XXX perhaps a bit too big
glColor3ubv(col);
glBegin(GL_POINTS);
- for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
- float mframe= (float)(sfra + i);
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++) {
+ float mframe = (float)(sfra + i);
if (BLI_dlrbTree_search_exact(&keys, compare_ak_cfraPtr, &mframe))
glVertex3fv(mpv->co);
@@ -291,15 +291,15 @@ void draw_motion_path_instance(Scene *scene,
/* Draw frame numbers of keyframes */
if (avs->path_viewflag & MOTIONPATH_VIEW_KFNOS) {
float co[3];
- for (i=0, mpv=mpv_start; i < len; i++, mpv++) {
- float mframe= (float)(sfra + i);
+ for (i = 0, mpv = mpv_start; i < len; i++, mpv++) {
+ float mframe = (float)(sfra + i);
if (BLI_dlrbTree_search_exact(&keys, compare_ak_cfraPtr, &mframe)) {
char numstr[32];
- sprintf(numstr, "%d", (sfra+i));
+ sprintf(numstr, "%d", (sfra + i));
mul_v3_m4v3(co, ob->imat, mpv->co);
- view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE|V3D_CACHE_TEXT_ASCII, col);
+ view3d_cached_text_draw_add(co, numstr, 0, V3D_CACHE_TEXT_WORLDSPACE | V3D_CACHE_TEXT_ASCII, col);
}
}
}