Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_270.c
| Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | static void do_version_bones_super_bbone(ListBase *lb) | ||||
| for (Bone *bone = lb->first; bone; bone = bone->next) { | for (Bone *bone = lb->first; bone; bone = bone->next) { | ||||
| bone->scaleIn = 1.0f; | bone->scaleIn = 1.0f; | ||||
| bone->scaleOut = 1.0f; | bone->scaleOut = 1.0f; | ||||
| do_version_bones_super_bbone(&bone->childbase); | do_version_bones_super_bbone(&bone->childbase); | ||||
| } | } | ||||
| } | } | ||||
| static void do_version_localview_regiondata(RegionView3D *rv3d) | |||||
| { | |||||
| RegionView3D *old_lvd = rv3d->localvd; | |||||
| if (!old_lvd) { | |||||
| return; | |||||
| } | |||||
| LocalViewRegionData *new_lvd = MEM_mallocN(sizeof(*rv3d->localviewd), __func__); | |||||
| new_lvd->camzoom = old_lvd->camzoom; | |||||
| new_lvd->persp = old_lvd->persp; | |||||
| new_lvd->view = old_lvd->view; | |||||
| new_lvd->dist = old_lvd->dist; | |||||
| copy_qt_qt(new_lvd->viewquat, old_lvd->viewquat); | |||||
| copy_v3_v3(new_lvd->ofs, old_lvd->ofs); | |||||
| rv3d->localviewd = new_lvd; | |||||
| /* remove old data */ | |||||
| MEM_freeN(rv3d->localvd); | |||||
| } | |||||
| static void do_version_localview_areadata(View3D *v3d) | |||||
| { | |||||
| View3D *old_lvd = v3d->localvd; | |||||
| if (!old_lvd) { | |||||
| return; | |||||
| } | |||||
| LocalViewAreaData *new_lvd = MEM_mallocN(sizeof(*v3d->localviewd), __func__); | |||||
| new_lvd->info.viewbits = (v3d->lay >> 24); /* old local view used last byte of v3d->lay */ | |||||
| new_lvd->near = old_lvd->near; | |||||
| new_lvd->far = old_lvd->far; | |||||
| new_lvd->drawtype = old_lvd->drawtype; | |||||
| new_lvd->camera = old_lvd->camera; | |||||
| v3d->localviewd = new_lvd; | |||||
| /* remove old data */ | |||||
| MEM_freeN(v3d->localvd); | |||||
| } | |||||
| void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) | void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) | ||||
| { | { | ||||
| if (!MAIN_VERSION_ATLEAST(main, 270, 0)) { | if (!MAIN_VERSION_ATLEAST(main, 270, 0)) { | ||||
| if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "float", "profile")) { | if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "float", "profile")) { | ||||
| Object *ob; | Object *ob; | ||||
| for (ob = main->object.first; ob; ob = ob->id.next) { | for (ob = main->object.first; ob; ob = ob->id.next) { | ||||
| ▲ Show 20 Lines • Show All 1,132 Lines • ▼ Show 20 Lines | if (!DNA_struct_elem_find(fd->filesdna, "bGPDstroke", "bGPDpalettecolor", "palcolor")) { | ||||
| if (palette->colors.first) | if (palette->colors.first) | ||||
| BKE_gpencil_palettecolor_setactive(palette, palette->colors.first); | BKE_gpencil_palettecolor_setactive(palette, palette->colors.first); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* ------- end of grease pencil initialization --------------- */ | /* ------- end of grease pencil initialization --------------- */ | ||||
| } | } | ||||
| { | |||||
| /* New local view storage */ | |||||
| if (!DNA_struct_elem_find(fd->filesdna, "View3D", "LocalViewAreaData", "localviewd")) { | |||||
| /* update area/region data */ | |||||
| for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) { | |||||
| for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { | |||||
| for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { | |||||
| if (sl->spacetype == SPACE_VIEW3D) { | |||||
| ListBase *lb = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; | |||||
| do_version_localview_areadata((View3D *)sl); | |||||
| for (ARegion *ar = lb->first; ar; ar = ar->next) { | |||||
| if (ar->regiontype == RGN_TYPE_WINDOW) { | |||||
| do_version_localview_regiondata(ar->regiondata); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| /* update object data */ | |||||
| for (Object *ob = main->object.first; ob; ob = ob->id.next) { | |||||
| ob->localview.viewbits = (ob->lay >> 24); /* old local view used last byte of ob->lay */ | |||||
| } | |||||
| } | |||||
| } | |||||
| } | } | ||||