diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-11-30 06:51:16 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-11-30 06:56:20 +0300 |
commit | 28316493bd82f5e5d2be40effdad4431f9c49c6e (patch) | |
tree | 6e3ce9b8b799344ec168a3fb423a4ad0cdafe8a6 /source/blender/blenloader/intern/versioning_250.c | |
parent | 1119f1eb3b5f5e509238eb376102079a9fd150c4 (diff) |
Cleanup: style
Diffstat (limited to 'source/blender/blenloader/intern/versioning_250.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_250.c | 364 |
1 files changed, 182 insertions, 182 deletions
diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index ff56875e8fd..d9c0bd8a927 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -106,11 +106,11 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb) /* initialize view2d data for header region, to allow panning */ /* is copy from ui_view2d.c */ - ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT); + ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT); ar->v2d.keepofs = V2D_LOCKOFS_Y; ar->v2d.keeptot = V2D_KEEPTOT_STRICT; - ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; - ar->v2d.flag = (V2D_PIXELOFS_X|V2D_PIXELOFS_Y); + ar->v2d.align = V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y; + ar->v2d.flag = (V2D_PIXELOFS_X | V2D_PIXELOFS_Y); } static void sequencer_init_preview_region(ARegion *ar) @@ -149,7 +149,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) BLI_addtail(lb, ar); ar->regiontype = RGN_TYPE_CHANNELS; ar->alignment = RGN_ALIGN_LEFT; - ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); + ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); /* for some reason, this doesn't seem to go auto like for NLA... */ ar = MEM_callocN(sizeof(ARegion), "area region from do_versions"); @@ -191,7 +191,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) BLI_addtail(lb, ar); ar->regiontype = RGN_TYPE_UI; ar->alignment = RGN_ALIGN_LEFT; - ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); + ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; /* temporarily hide it */ ar->flag = RGN_FLAG_HIDDEN; @@ -208,7 +208,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) ar->alignment = RGN_ALIGN_TOP; break; case SPACE_SEQ: - ar_main = (ARegion*) lb->first; + ar_main = (ARegion *)lb->first; for (; ar_main; ar_main = ar_main->next) { if (ar_main->regiontype == RGN_TYPE_WINDOW) break; @@ -231,7 +231,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) BLI_addtail(lb, ar); ar->regiontype = RGN_TYPE_TOOL_PROPS; - ar->alignment = RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; + ar->alignment = RGN_ALIGN_BOTTOM | RGN_SPLIT_PREV; ar->flag = RGN_FLAG_HIDDEN; /* buttons/list view */ @@ -271,132 +271,132 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb) break; case SPACE_OUTLINER: - { - SpaceOops *soops = (SpaceOops *)sl; + { + SpaceOops *soops = (SpaceOops *)sl; - memcpy(&ar->v2d, &soops->v2d, sizeof(View2D)); + memcpy(&ar->v2d, &soops->v2d, sizeof(View2D)); - ar->v2d.scroll &= ~V2D_SCROLL_LEFT; - ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); - ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y); - ar->v2d.keepzoom |= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT); - ar->v2d.keeptot = V2D_KEEPTOT_STRICT; - ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f; - //ar->v2d.flag |= V2D_IS_INITIALISED; - } + ar->v2d.scroll &= ~V2D_SCROLL_LEFT; + ar->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); + ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y); + ar->v2d.keepzoom |= (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_KEEPASPECT); + ar->v2d.keeptot = V2D_KEEPTOT_STRICT; + ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f; + //ar->v2d.flag |= V2D_IS_INITIALISED; break; + } case SPACE_IPO: - { - SpaceIpo *sipo = (SpaceIpo *)sl; - memcpy(&ar->v2d, &sipo->v2d, sizeof(View2D)); + { + SpaceIpo *sipo = (SpaceIpo *)sl; + memcpy(&ar->v2d, &sipo->v2d, sizeof(View2D)); - /* init mainarea view2d */ - ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); - ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL); + /* init mainarea view2d */ + ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL); + ar->v2d.scroll |= (V2D_SCROLL_LEFT | V2D_SCROLL_SCALE_VERTICAL); - ar->v2d.min[0] = FLT_MIN; - ar->v2d.min[1] = FLT_MIN; + ar->v2d.min[0] = FLT_MIN; + ar->v2d.min[1] = FLT_MIN; - ar->v2d.max[0] = MAXFRAMEF; - ar->v2d.max[1] = FLT_MAX; + ar->v2d.max[0] = MAXFRAMEF; + ar->v2d.max[1] = FLT_MAX; - //ar->v2d.flag |= V2D_IS_INITIALISED; - break; - } + //ar->v2d.flag |= V2D_IS_INITIALISED; + break; + } case SPACE_NLA: - { - SpaceNla *snla = (SpaceNla *)sl; - memcpy(&ar->v2d, &snla->v2d, sizeof(View2D)); + { + SpaceNla *snla = (SpaceNla *)sl; + memcpy(&ar->v2d, &snla->v2d, sizeof(View2D)); - ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; - ar->v2d.tot.ymax = 0.0f; + ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; + ar->v2d.tot.ymax = 0.0f; - ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); - ar->v2d.scroll |= (V2D_SCROLL_RIGHT); - ar->v2d.align = V2D_ALIGN_NO_POS_Y; - ar->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL; - break; - } + ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL); + ar->v2d.scroll |= (V2D_SCROLL_RIGHT); + ar->v2d.align = V2D_ALIGN_NO_POS_Y; + ar->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL; + break; + } case SPACE_ACTION: - { - SpaceAction *saction = (SpaceAction *) sl; - - /* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */ - ar->v2d.tot.xmin = -20.0f; - ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; - ar->v2d.tot.xmax = (float)((sa->winx > 120) ? (sa->winx) : 120); - ar->v2d.tot.ymax = 0.0f; - - ar->v2d.cur = ar->v2d.tot; - - ar->v2d.min[0] = 0.0f; - ar->v2d.min[1] = 0.0f; - - ar->v2d.max[0] = MAXFRAMEF; - ar->v2d.max[1] = FLT_MAX; - - ar->v2d.minzoom = 0.01f; - ar->v2d.maxzoom = 50; - ar->v2d.scroll = (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); - ar->v2d.scroll |= (V2D_SCROLL_RIGHT); - ar->v2d.keepzoom = V2D_LOCKZOOM_Y; - ar->v2d.align = V2D_ALIGN_NO_POS_Y; - ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; - - /* for old files with ShapeKey editors open + an action set, clear the action as - * it doesn't make sense in the new system (i.e. violates concept that ShapeKey edit - * only shows ShapeKey-rooted actions only) - */ - if (saction->mode == SACTCONT_SHAPEKEY) - saction->action = NULL; - break; - } + { + SpaceAction *saction = (SpaceAction *)sl; + + /* we totally reinit the view for the Action Editor, as some old instances had some weird cruft set */ + ar->v2d.tot.xmin = -20.0f; + ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; + ar->v2d.tot.xmax = (float)((sa->winx > 120) ? (sa->winx) : 120); + ar->v2d.tot.ymax = 0.0f; + + ar->v2d.cur = ar->v2d.tot; + + ar->v2d.min[0] = 0.0f; + ar->v2d.min[1] = 0.0f; + + ar->v2d.max[0] = MAXFRAMEF; + ar->v2d.max[1] = FLT_MAX; + + ar->v2d.minzoom = 0.01f; + ar->v2d.maxzoom = 50; + ar->v2d.scroll = (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL); + ar->v2d.scroll |= (V2D_SCROLL_RIGHT); + ar->v2d.keepzoom = V2D_LOCKZOOM_Y; + ar->v2d.align = V2D_ALIGN_NO_POS_Y; + ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL; + + /* for old files with ShapeKey editors open + an action set, clear the action as + * it doesn't make sense in the new system (i.e. violates concept that ShapeKey edit + * only shows ShapeKey-rooted actions only) + */ + if (saction->mode == SACTCONT_SHAPEKEY) + saction->action = NULL; + break; + } case SPACE_SEQ: - { - SpaceSeq *sseq = (SpaceSeq *)sl; - memcpy(&ar->v2d, &sseq->v2d, sizeof(View2D)); + { + SpaceSeq *sseq = (SpaceSeq *)sl; + memcpy(&ar->v2d, &sseq->v2d, sizeof(View2D)); - ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); - ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL); - ar->v2d.align = V2D_ALIGN_NO_NEG_Y; - ar->v2d.flag |= V2D_IS_INITIALISED; - break; - } + ar->v2d.scroll |= (V2D_SCROLL_BOTTOM | V2D_SCROLL_SCALE_HORIZONTAL); + ar->v2d.scroll |= (V2D_SCROLL_LEFT | V2D_SCROLL_SCALE_VERTICAL); + ar->v2d.align = V2D_ALIGN_NO_NEG_Y; + ar->v2d.flag |= V2D_IS_INITIALISED; + break; + } case SPACE_NODE: - { - SpaceNode *snode = (SpaceNode *)sl; - memcpy(&ar->v2d, &snode->v2d, sizeof(View2D)); + { + SpaceNode *snode = (SpaceNode *)sl; + memcpy(&ar->v2d, &snode->v2d, sizeof(View2D)); - ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); - ar->v2d.keepzoom = V2D_LIMITZOOM|V2D_KEEPASPECT; - break; - } + ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); + ar->v2d.keepzoom = V2D_LIMITZOOM | V2D_KEEPASPECT; + break; + } case SPACE_BUTS: - { - SpaceButs *sbuts = (SpaceButs *)sl; - memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D)); + { + SpaceButs *sbuts = (SpaceButs *)sl; + memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D)); - ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); - break; - } + ar->v2d.scroll |= (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); + break; + } case SPACE_FILE: - { - // SpaceFile *sfile = (SpaceFile *)sl; - ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0; - ar->v2d.tot.xmax = ar->winx; - ar->v2d.tot.ymax = ar->winy; - ar->v2d.cur = ar->v2d.tot; - ar->regiontype = RGN_TYPE_WINDOW; - ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM); - ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y); - ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT); - break; - } + { + // SpaceFile *sfile = (SpaceFile *)sl; + ar->v2d.tot.xmin = ar->v2d.tot.ymin = 0; + ar->v2d.tot.xmax = ar->winx; + ar->v2d.tot.ymax = ar->winy; + ar->v2d.cur = ar->v2d.tot; + ar->regiontype = RGN_TYPE_WINDOW; + ar->v2d.scroll = (V2D_SCROLL_RIGHT | V2D_SCROLL_BOTTOM); + ar->v2d.align = (V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_POS_Y); + ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT); + break; + } case SPACE_TEXT: - { - SpaceText *st = (SpaceText *)sl; - st->flags |= ST_FIND_WRAP; - } + { + SpaceText *st = (SpaceText *)sl; + st->flags |= ST_FIND_WRAP; + } //case SPACE_XXX: // FIXME... add other ones // memcpy(&ar->v2d, &((SpaceXxx *)sl)->v2d, sizeof(View2D)); // break; @@ -420,13 +420,13 @@ static void do_versions_windowmanager_2_50(bScreen *screen) /* space imageselect is deprecated */ for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IMASEL) - sl->spacetype = SPACE_EMPTY; /* spacedata then matches */ + sl->spacetype = SPACE_EMPTY; /* spacedata then matches */ } /* space sound is deprecated */ for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_SOUND) - sl->spacetype = SPACE_EMPTY; /* spacedata then matches */ + sl->spacetype = SPACE_EMPTY; /* spacedata then matches */ } /* pushed back spaces also need regions! */ @@ -446,7 +446,7 @@ static void versions_gpencil_add_main(ListBase *lb, ID *id, const char *name) BLI_addtail(lb, id); id->us = 1; id->flag = LIB_FAKEUSER; - *( (short *)id->name )= ID_GD; + *( (short *)id->name) = ID_GD; new_id(lb, id, name); /* alphabetic insertion: is in new_id */ @@ -464,29 +464,29 @@ static void do_versions_gpencil_2_50(Main *main, bScreen *screen) for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D*) sl; + View3D *v3d = (View3D *)sl; if (v3d->gpd) { versions_gpencil_add_main(&main->gpencil, (ID *)v3d->gpd, "GPencil View3D"); v3d->gpd = NULL; } } else if (sl->spacetype == SPACE_NODE) { - SpaceNode *snode = (SpaceNode *) sl; + SpaceNode *snode = (SpaceNode *)sl; if (snode->gpd) { versions_gpencil_add_main(&main->gpencil, (ID *)snode->gpd, "GPencil Node"); snode->gpd = NULL; } } else if (sl->spacetype == SPACE_SEQ) { - SpaceSeq *sseq = (SpaceSeq *) sl; + SpaceSeq *sseq = (SpaceSeq *)sl; if (sseq->gpd) { versions_gpencil_add_main(&main->gpencil, (ID *)sseq->gpd, "GPencil Node"); sseq->gpd = NULL; } } else if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *) sl; -#if 0 /* see comment on r28002 */ + SpaceImage *sima = (SpaceImage *)sl; +#if 0 /* see comment on r28002 */ if (sima->gpd) { versions_gpencil_add_main(&main->gpencil, (ID *)sima->gpd, "GPencil Image"); sima->gpd = NULL; @@ -508,7 +508,7 @@ static void do_version_mdef_250(Main *main) for (ob = main->object.first; ob; ob = ob->id.next) { for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_MeshDeform) { - mmd = (MeshDeformModifierData*) md; + mmd = (MeshDeformModifierData *)md; if (mmd->bindcos) { /* make bindcos NULL in order to trick older versions @@ -577,14 +577,14 @@ static bNodeSocket *do_versions_node_group_add_socket_2_56_2(bNodeTree *ngroup, gsock->link = NULL; /* assign new unique index */ gsock->own_index = ngroup->cur_index++; - gsock->limit = (in_out==SOCK_IN ? 0xFFF : 1); + gsock->limit = (in_out == SOCK_IN ? 0xFFF : 1); // if (stype->value_structsize > 0) // gsock->default_value = MEM_callocN(stype->value_structsize, "default socket value"); - BLI_addtail(in_out==SOCK_IN ? &ngroup->inputs : &ngroup->outputs, gsock); + BLI_addtail(in_out == SOCK_IN ? &ngroup->inputs : &ngroup->outputs, gsock); - ngroup->update |= (in_out==SOCK_IN ? NTREE_UPDATE_GROUP_IN : NTREE_UPDATE_GROUP_OUT); + ngroup->update |= (in_out == SOCK_IN ? NTREE_UPDATE_GROUP_IN : NTREE_UPDATE_GROUP_OUT); return gsock; } @@ -657,7 +657,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene->ed && scene->ed->seqbasep) { - SEQ_BEGIN (scene->ed, seq) + SEQ_BEGIN(scene->ed, seq) { if (seq->type == SEQ_TYPE_SOUND_HD) { char str[FILE_MAX]; @@ -669,7 +669,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) #define SEQ_USE_PROXY_CUSTOM_FILE (1 << 21) /* don't know, if anybody used that this way, but just in case, upgrade to new way... */ if ((seq->flag & SEQ_USE_PROXY_CUSTOM_FILE) && - !(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) + !(seq->flag & SEQ_USE_PROXY_CUSTOM_DIR)) { BLI_snprintf(seq->strip->proxy->dir, FILE_MAXDIR, "%s/BL_proxy", seq->strip->dir); } @@ -813,7 +813,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ob->matbits = MEM_calloc_arrayN(ob->totcol, sizeof(char), "ob->matbits"); for (a = 0; a < ob->totcol; a++) - ob->matbits[a] = (ob->colbits & (1<<a)) != 0; + ob->matbits[a] = (ob->colbits & (1 << a)) != 0; } } @@ -862,7 +862,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (ob = bmain->object.first; ob; ob = ob->id.next) { /* fluid-sim stuff */ - FluidsimModifierData *fluidmd = (FluidsimModifierData *) modifiers_findByType(ob, eModifierType_Fluidsim); + FluidsimModifierData *fluidmd = (FluidsimModifierData *)modifiers_findByType(ob, eModifierType_Fluidsim); if (fluidmd) fluidmd->fss->fmd = fluidmd; @@ -896,7 +896,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* Assign proper global gravity weights for dynamics (only z-coordinate is taken into account) */ if (do_gravity) { for (part = bmain->particle.first; part; part = part->id.next) - part->effector_weights->global_gravity = part->acc[2]/-9.81f; + part->effector_weights->global_gravity = part->acc[2] / -9.81f; } for (ob = bmain->object.first; ob; ob = ob->id.next) { @@ -904,13 +904,13 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (do_gravity) { for (md = ob->modifiers.first; md; md = md->next) { - ClothModifierData *clmd = (ClothModifierData *) modifiers_findByType(ob, eModifierType_Cloth); + ClothModifierData *clmd = (ClothModifierData *)modifiers_findByType(ob, eModifierType_Cloth); if (clmd) - clmd->sim_parms->effector_weights->global_gravity = clmd->sim_parms->gravity[2]/-9.81f; + clmd->sim_parms->effector_weights->global_gravity = clmd->sim_parms->gravity[2] / -9.81f; } if (ob->soft) - ob->soft->effector_weights->global_gravity = ob->soft->grav/9.81f; + ob->soft->effector_weights->global_gravity = ob->soft->grav / 9.81f; } /* Normal wind shape is plane */ @@ -974,7 +974,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (lt = bmain->latt.first; lt; lt = lt->id.next) { if ((key = blo_do_versions_newlibadr(fd, lib, lt->key)) && key->refkey) { data = key->refkey->data; - tot = MIN2(lt->pntsu*lt->pntsv*lt->pntsw, key->refkey->totelem); + tot = MIN2(lt->pntsu * lt->pntsv * lt->pntsw, key->refkey->totelem); for (a = 0; a < tot; a++, data += 3) copy_v3_v3(lt->def[a].vec, data); @@ -990,16 +990,16 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) BezTriple *bezt = nu->bezt; for (a = 0; a < nu->pntsu; a++, bezt++) { - copy_v3_v3(bezt->vec[0], data); data+=3; - copy_v3_v3(bezt->vec[1], data); data+=3; - copy_v3_v3(bezt->vec[2], data); data+=3; + copy_v3_v3(bezt->vec[0], data); data += 3; + copy_v3_v3(bezt->vec[1], data); data += 3; + copy_v3_v3(bezt->vec[2], data); data += 3; bezt->alfa = *data; data++; } } else if (nu->bp) { BPoint *bp = nu->bp; - for (a = 0; a < nu->pntsu*nu->pntsv; a++, bp++) { + for (a = 0; a < nu->pntsu * nu->pntsv; a++, bp++) { copy_v3_v3(bp->vec, data); data += 3; bp->alfa = *data; data++; } @@ -1054,7 +1054,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (sa = screen->areabase.first; sa; sa = sa->next) { for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_VIEW3D) { - View3D *v3d = (View3D *) sl; + View3D *v3d = (View3D *)sl; if (v3d->drawtype == OB_MATERIAL) v3d->drawtype = OB_SOLID; } @@ -1117,7 +1117,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) multires_load_old_250(me); for (ob = bmain->object.first; ob; ob = ob->id.next) { - MultiresModifierData *mmd = (MultiresModifierData *) modifiers_findByType(ob, eModifierType_Multires); + MultiresModifierData *mmd = (MultiresModifierData *)modifiers_findByType(ob, eModifierType_Multires); if (mmd) { mmd->totlvl--; @@ -1211,7 +1211,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (sseq->mainb == 0) sseq->mainb = SEQ_DRAW_IMG_IMBUF; - ar_main = (ARegion*)regionbase->first; + ar_main = (ARegion *)regionbase->first; for (; ar_main; ar_main = ar_main->next) { if (ar_main->regiontype == RGN_TYPE_WINDOW) break; @@ -1356,7 +1356,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) regionbase = &sl->regionbase; if (ELEM(sl->spacetype, SPACE_ACTION, SPACE_NLA)) { - for (ar = (ARegion*) regionbase->first; ar; ar = ar->next) { + for (ar = (ARegion *)regionbase->first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_WINDOW) { ar->v2d.cur.ymax = ar->v2d.tot.ymax = 0.0f; ar->v2d.cur.ymin = ar->v2d.tot.ymin = (float)(-sa->winy) / 3.0f; @@ -1386,7 +1386,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if ((sce->r.ffcodecdata.flags & FFMPEG_MULTIPLEX_AUDIO) == 0) sce->r.ffcodecdata.audio_codec = 0x0; // CODEC_ID_NONE - SEQ_BEGIN (sce->ed, seq) + SEQ_BEGIN(sce->ed, seq) { seq->volume = 1.0f; } @@ -1422,7 +1422,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) regionbase = &sl->regionbase; } - ar_preview = (ARegion*) regionbase->first; + ar_preview = (ARegion *)regionbase->first; for (; ar_preview; ar_preview = ar_preview->next) { if (ar_preview->regiontype == RGN_TYPE_PREVIEW) break; @@ -1437,7 +1437,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } /* sequencer changes */ } - if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */ + if (bmain->versionfile <= 251) { /* 2.5.1 had no subversions */ bScreen *sc; /* Blender 2.5.2 - subversion 0 introduced a new setting: V3D_RENDER_OVERRIDE. @@ -1474,7 +1474,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Fluidsim) { - FluidsimModifierData *fmd = (FluidsimModifierData *) md; + FluidsimModifierData *fmd = (FluidsimModifierData *)md; fmd->fss->flag |= OB_FLUIDSIM_ACTIVE; fmd->fss->flag |= OB_FLUIDSIM_OVERRIDE_TIME; } @@ -1488,7 +1488,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) while (node) { if (node->type == CMP_NODE_COLORBALANCE) { - NodeColorBalance *n = (NodeColorBalance *) node->storage; + NodeColorBalance *n = (NodeColorBalance *)node->storage; n->lift[0] += 1.f; n->lift[1] += 1.f; n->lift[2] += 1.f; @@ -1503,7 +1503,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) while (node) { if (node->type == CMP_NODE_COLORBALANCE) { - NodeColorBalance *n = (NodeColorBalance *) node->storage; + NodeColorBalance *n = (NodeColorBalance *)node->storage; n->lift[0] += 1.f; n->lift[1] += 1.f; n->lift[2] += 1.f; @@ -1534,7 +1534,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *) sl; + SpaceImage *sima = (SpaceImage *)sl; scopes_new(&sima->scopes); } } @@ -1556,7 +1556,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_NODE) { - SpaceNode *snode = (SpaceNode *) sl; + SpaceNode *snode = (SpaceNode *)sl; ListBase *regionbase; ARegion *ar; @@ -1588,32 +1588,32 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* parent type to modifier */ for (ob = bmain->object.first; ob; ob = ob->id.next) { if (ob->parent) { - Object *parent = (Object *) blo_do_versions_newlibadr(fd, lib, ob->parent); + Object *parent = (Object *)blo_do_versions_newlibadr(fd, lib, ob->parent); if (parent) { /* parent may not be in group */ if (parent->type == OB_ARMATURE && ob->partype == PARSKEL) { ArmatureModifierData *amd; - bArmature *arm = (bArmature *) blo_do_versions_newlibadr(fd, lib, parent->data); + bArmature *arm = (bArmature *)blo_do_versions_newlibadr(fd, lib, parent->data); - amd = (ArmatureModifierData*) modifier_new(eModifierType_Armature); + amd = (ArmatureModifierData *)modifier_new(eModifierType_Armature); amd->object = ob->parent; - BLI_addtail((ListBase*)&ob->modifiers, amd); + BLI_addtail((ListBase *)&ob->modifiers, amd); amd->deformflag = arm->deformflag; ob->partype = PAROBJECT; } else if (parent->type == OB_LATTICE && ob->partype == PARSKEL) { LatticeModifierData *lmd; - lmd = (LatticeModifierData*) modifier_new(eModifierType_Lattice); + lmd = (LatticeModifierData *)modifier_new(eModifierType_Lattice); lmd->object = ob->parent; - BLI_addtail((ListBase*)&ob->modifiers, lmd); + BLI_addtail((ListBase *)&ob->modifiers, lmd); ob->partype = PAROBJECT; } else if (parent->type == OB_CURVE && ob->partype == PARCURVE) { CurveModifierData *cmd; - cmd = (CurveModifierData*) modifier_new(eModifierType_Curve); + cmd = (CurveModifierData *)modifier_new(eModifierType_Curve); cmd->object = ob->parent; - BLI_addtail((ListBase*)&ob->modifiers, cmd); + BLI_addtail((ListBase *)&ob->modifiers, cmd); ob->partype = PAROBJECT; } } @@ -1624,8 +1624,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (scene = bmain->scene.first; scene; scene = scene->id.next) { int i; for (i = 0; i < 20; i++) { - if (scene->lay & (1<<i)) { - scene->layact = 1<<i; + if (scene->lay & (1 << i)) { + scene->layact = 1 << i; break; } } @@ -1648,7 +1648,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (scene = bmain->scene.first; scene; scene = scene->id.next) { if (scene) { Sequence *seq; - SEQ_BEGIN (scene->ed, seq) + SEQ_BEGIN(scene->ed, seq) { if (seq->sat == 0.0f) { seq->sat = 1.0f; @@ -1710,11 +1710,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* spacing was originally in pixels, convert it to percentage for new version * size should not be zero due to sanity check above */ - brush->spacing = (int)(100 * ((float)brush->spacing) / ((float) brush->size)); + brush->spacing = (int)(100 * ((float)brush->spacing) / ((float)brush->size)); if (brush->add_col[0] == 0 && - brush->add_col[1] == 0 && - brush->add_col[2] == 0) + brush->add_col[1] == 0 && + brush->add_col[2] == 0) { brush->add_col[0] = 1.00f; brush->add_col[1] = 0.39f; @@ -1722,8 +1722,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } if (brush->sub_col[0] == 0 && - brush->sub_col[1] == 0 && - brush->sub_col[2] == 0) + brush->sub_col[1] == 0 && + brush->sub_col[2] == 0) { brush->sub_col[0] = 0.39f; brush->sub_col[1] = 0.39f; @@ -1762,11 +1762,11 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) smd->domain->vorticity = 2.0f; smd->domain->time_scale = 1.0f; - if (!(smd->domain->flags & (1<<4))) + if (!(smd->domain->flags & (1 << 4))) continue; /* delete old MOD_SMOKE_INITVELOCITY flag */ - smd->domain->flags &= ~(1<<4); + smd->domain->flags &= ~(1 << 4); /* for now just add it to all flow objects in the scene */ { @@ -1818,7 +1818,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl; for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_INFO) { - SpaceInfo *sinfo = (SpaceInfo *) sl; + SpaceInfo *sinfo = (SpaceInfo *)sl; ARegion *ar; sinfo->rpt_mask = INFO_RPT_OP; @@ -1826,9 +1826,9 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (ar = sa->regionbase.first; ar; ar = ar->next) { if (ar->regiontype == RGN_TYPE_WINDOW) { ar->v2d.scroll = (V2D_SCROLL_RIGHT); - ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y; /* align bottom left */ + ar->v2d.align = V2D_ALIGN_NO_NEG_X | V2D_ALIGN_NO_NEG_Y; /* align bottom left */ ar->v2d.keepofs = V2D_LOCKOFS_X; - ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_LIMITZOOM|V2D_KEEPASPECT); + ar->v2d.keepzoom = (V2D_LOCKZOOM_X | V2D_LOCKZOOM_Y | V2D_LIMITZOOM | V2D_KEEPASPECT); ar->v2d.keeptot = V2D_KEEPTOT_BOUNDS; ar->v2d.minzoom = ar->v2d.maxzoom = 1.0f; } @@ -1867,7 +1867,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) SpaceLink *sl; for (sl = sa->spacedata.first; sl; sl = sl->next) { if (sl->spacetype == SPACE_IMAGE) { - SpaceImage *sima = (SpaceImage *) sl; + SpaceImage *sima = (SpaceImage *)sl; if (sima->sample_line_hist.height == 0) sima->sample_line_hist.height = 100; } @@ -1921,21 +1921,21 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* node sockets are not exposed automatically any more, * this mimics the old behavior by adding all unlinked sockets to groups. */ - for (ntree=bmain->nodetree.first; ntree; ntree=ntree->id.next) { + for (ntree = bmain->nodetree.first; ntree; ntree = ntree->id.next) { /* this adds copies and links from all unlinked internal sockets to group inputs/outputs. */ /* first make sure the own_index for new sockets is valid */ - for (node=ntree->nodes.first; node; node=node->next) { + for (node = ntree->nodes.first; node; node = node->next) { for (sock = node->inputs.first; sock; sock = sock->next) if (sock->own_index >= ntree->cur_index) - ntree->cur_index = sock->own_index+1; + ntree->cur_index = sock->own_index + 1; for (sock = node->outputs.first; sock; sock = sock->next) if (sock->own_index >= ntree->cur_index) - ntree->cur_index = sock->own_index+1; + ntree->cur_index = sock->own_index + 1; } /* add ntree->inputs/ntree->outputs sockets for all unlinked sockets in the group tree. */ - for (node=ntree->nodes.first; node; node=node->next) { + for (node = ntree->nodes.first; node; node = node->next) { for (sock = node->inputs.first; sock; sock = sock->next) { if (!sock->link && !nodeSocketIsHidden(sock)) { @@ -1959,7 +1959,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) } } for (sock = node->outputs.first; sock; sock = sock->next) { - if (nodeCountSocketLinks(ntree, sock)==0 && !nodeSocketIsHidden(sock)) { + if (nodeCountSocketLinks(ntree, sock) == 0 && !nodeSocketIsHidden(sock)) { gsock = do_versions_node_group_add_socket_2_56_2(ntree, sock->name, sock->type, SOCK_OUT); /* initialize the default socket value */ @@ -2001,7 +2001,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) if (sc->redraws_flag == 0) { /* just initialize to default? */ /* XXX: we could also have iterated through areas, and taken them from the first timeline available... */ - sc->redraws_flag = TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN; + sc->redraws_flag = TIME_ALL_3D_WIN | TIME_ALL_ANIM_WIN; } } @@ -2015,7 +2015,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) ModifierData *md; for (md = ob->modifiers.first; md; md = md->next) { if (md->type == eModifierType_Solidify) { - SolidifyModifierData *smd = (SolidifyModifierData *) md; + SolidifyModifierData *smd = (SolidifyModifierData *)md; if (smd->flag & MOD_SOLIDIFY_RIM_MATERIAL) { smd->mat_ofs_rim = 1; smd->flag &= ~MOD_SOLIDIFY_RIM_MATERIAL; @@ -2158,7 +2158,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) for (act = bmain->action.first; act; act = act->id.next) { for (fcu = act->curves.first; fcu; fcu = fcu->next) { BezTriple *bezt; - unsigned int i = 0; + uint i = 0; /* only need to touch curves that had this flag set */ if ((fcu->flag & FCURVE_AUTO_HANDLES) == 0) @@ -2187,7 +2187,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) bNode *node; bNodeSocket *sock; - for (node=ntree->nodes.first; node; node=node->next) { + for (node = ntree->nodes.first; node; node = node->next) { for (sock = node->inputs.first; sock; sock = sock->next) do_versions_socket_default_value_259(sock); for (sock = node->outputs.first; sock; sock = sock->next) |