[Bf-blender-cvs] [e7d47c28217] workspaces: Indent to avoid conflicts
Campbell Barton
noreply at git.blender.org
Tue Apr 4 09:37:37 CEST 2017
Commit: e7d47c282170134c40430cc5eb14a2d4ec1fe2c0
Author: Campbell Barton
Date: Tue Apr 4 17:37:20 2017 +1000
Branches: workspaces
https://developer.blender.org/rBe7d47c282170134c40430cc5eb14a2d4ec1fe2c0
Indent to avoid conflicts
without this many lines differ from 2.8x
===================================================================
M source/blender/blenloader/intern/readfile.c
===================================================================
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 95367a6189e..56f9621c467 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6888,221 +6888,225 @@ static void lib_link_workspace_layout_restore(struct IDNameLib_Map *id_map, Main
{
bScreen *screen = BKE_workspace_layout_screen_get(layout);
- 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) {
- View3D *v3d = (View3D *)sl;
- BGpic *bgpic;
- ARegion *ar;
-
- v3d->camera = restore_pointer_by_name(id_map, (ID *)v3d->camera, USER_REAL);
- v3d->ob_centre = restore_pointer_by_name(id_map, (ID *)v3d->ob_centre, USER_REAL);
-
- for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
- if ((bgpic->ima = restore_pointer_by_name(id_map, (ID *)bgpic->ima, USER_IGNORE))) {
- id_us_plus((ID *)bgpic->ima);
+ /* avoid conflicts with 2.8x branch */
+ {
+ 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) {
+ View3D *v3d = (View3D *)sl;
+ BGpic *bgpic;
+ ARegion *ar;
+
+ v3d->camera = restore_pointer_by_name(id_map, (ID *)v3d->camera, USER_REAL);
+ v3d->ob_centre = restore_pointer_by_name(id_map, (ID *)v3d->ob_centre, USER_REAL);
+
+ for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next) {
+ if ((bgpic->ima = restore_pointer_by_name(id_map, (ID *)bgpic->ima, USER_IGNORE))) {
+ id_us_plus((ID *)bgpic->ima);
+ }
+ if ((bgpic->clip = restore_pointer_by_name(id_map, (ID *)bgpic->clip, USER_IGNORE))) {
+ id_us_plus((ID *)bgpic->clip);
+ }
}
- if ((bgpic->clip = restore_pointer_by_name(id_map, (ID *)bgpic->clip, USER_IGNORE))) {
- id_us_plus((ID *)bgpic->clip);
+
+ /* not very nice, but could help */
+ if ((v3d->layact & v3d->lay) == 0) v3d->layact = v3d->lay;
+
+ /* free render engines for now */
+ for (ar = sa->regionbase.first; ar; ar = ar->next) {
+ RegionView3D *rv3d= ar->regiondata;
+
+ if (rv3d && rv3d->render_engine) {
+ RE_engine_free(rv3d->render_engine);
+ rv3d->render_engine = NULL;
+ }
}
}
-
- /* not very nice, but could help */
- if ((v3d->layact & v3d->lay) == 0) v3d->layact = v3d->lay;
-
- /* free render engines for now */
- for (ar = sa->regionbase.first; ar; ar = ar->next) {
- RegionView3D *rv3d= ar->regiondata;
+ else if (sl->spacetype == SPACE_IPO) {
+ SpaceIpo *sipo = (SpaceIpo *)sl;
+ bDopeSheet *ads = sipo->ads;
- if (rv3d && rv3d->render_engine) {
- RE_engine_free(rv3d->render_engine);
- rv3d->render_engine = NULL;
+ if (ads) {
+ ads->source = restore_pointer_by_name(id_map, (ID *)ads->source, USER_REAL);
+
+ if (ads->filter_grp)
+ ads->filter_grp = restore_pointer_by_name(id_map, (ID *)ads->filter_grp, USER_IGNORE);
}
+
+ /* force recalc of list of channels (i.e. includes calculating F-Curve colors)
+ * thus preventing the "black curves" problem post-undo
+ */
+ sipo->flag |= SIPO_TEMP_NEEDCHANSYNC;
}
- }
- else if (sl->spacetype == SPACE_IPO) {
- SpaceIpo *sipo = (SpaceIpo *)sl;
- bDopeSheet *ads = sipo->ads;
-
- if (ads) {
- ads->source = restore_pointer_by_name(id_map, (ID *)ads->source, USER_REAL);
+ else if (sl->spacetype == SPACE_BUTS) {
+ SpaceButs *sbuts = (SpaceButs *)sl;
+ sbuts->pinid = restore_pointer_by_name(id_map, sbuts->pinid, USER_IGNORE);
+ if (sbuts->pinid == NULL) {
+ sbuts->flag &= ~SB_PIN_CONTEXT;
+ }
- if (ads->filter_grp)
- ads->filter_grp = restore_pointer_by_name(id_map, (ID *)ads->filter_grp, USER_IGNORE);
+ /* TODO: restore path pointers: T40046
+ * (complicated because this contains data pointers too, not just ID)*/
+ MEM_SAFE_FREE(sbuts->path);
}
-
- /* force recalc of list of channels (i.e. includes calculating F-Curve colors)
- * thus preventing the "black curves" problem post-undo
- */
- sipo->flag |= SIPO_TEMP_NEEDCHANSYNC;
- }
- else if (sl->spacetype == SPACE_BUTS) {
- SpaceButs *sbuts = (SpaceButs *)sl;
- sbuts->pinid = restore_pointer_by_name(id_map, sbuts->pinid, USER_IGNORE);
- if (sbuts->pinid == NULL) {
- sbuts->flag &= ~SB_PIN_CONTEXT;
+ else if (sl->spacetype == SPACE_FILE) {
+ SpaceFile *sfile = (SpaceFile *)sl;
+ sfile->op = NULL;
+ sfile->previews_timer = NULL;
}
-
- /* TODO: restore path pointers: T40046
- * (complicated because this contains data pointers too, not just ID)*/
- MEM_SAFE_FREE(sbuts->path);
- }
- else if (sl->spacetype == SPACE_FILE) {
- SpaceFile *sfile = (SpaceFile *)sl;
- sfile->op = NULL;
- sfile->previews_timer = NULL;
- }
- else if (sl->spacetype == SPACE_ACTION) {
- SpaceAction *saction = (SpaceAction *)sl;
-
- saction->action = restore_pointer_by_name(id_map, (ID *)saction->action, USER_REAL);
- saction->ads.source = restore_pointer_by_name(id_map, (ID *)saction->ads.source, USER_REAL);
-
- if (saction->ads.filter_grp)
- saction->ads.filter_grp = restore_pointer_by_name(id_map, (ID *)saction->ads.filter_grp, USER_IGNORE);
-
- /* force recalc of list of channels, potentially updating the active action
- * while we're at it (as it can only be updated that way) [#28962]
- */
- saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
- }
- else if (sl->spacetype == SPACE_IMAGE) {
- SpaceImage *sima = (SpaceImage *)sl;
-
- sima->image = restore_pointer_by_name(id_map, (ID *)sima->image, USER_REAL);
-
- /* this will be freed, not worth attempting to find same scene,
- * since it gets initialized later */
- sima->iuser.scene = NULL;
-
+ else if (sl->spacetype == SPACE_ACTION) {
+ SpaceAction *saction = (SpaceAction *)sl;
+
+ saction->action = restore_pointer_by_name(id_map, (ID *)saction->action, USER_REAL);
+ saction->ads.source = restore_pointer_by_name(id_map, (ID *)saction->ads.source, USER_REAL);
+
+ if (saction->ads.filter_grp)
+ saction->ads.filter_grp = restore_pointer_by_name(id_map, (ID *)saction->ads.filter_grp, USER_IGNORE);
+
+
+ /* force recalc of list of channels, potentially updating the active action
+ * while we're at it (as it can only be updated that way) [#28962]
+ */
+ saction->flag |= SACTION_TEMP_NEEDCHANSYNC;
+ }
+ else if (sl->spacetype == SPACE_IMAGE) {
+ SpaceImage *sima = (SpaceImage *)sl;
+
+ sima->image = restore_pointer_by_name(id_map, (ID *)sima->image, USER_REAL);
+
+ /* this will be freed, not worth attempting to find same scene,
+ * since it gets initialized later */
+ sima->iuser.scene = NULL;
+
#if 0
- /* Those are allocated and freed by space code, no need to handle them here. */
- MEM_SAFE_FREE(sima->scopes.waveform_1);
- MEM_SAFE_FREE(sima->scopes.waveform_2);
- MEM_SAFE_FREE(sima->scopes.waveform_3);
- MEM_SAFE_FREE(sima->scopes.vecscope);
+ /* Those are allocated and freed by space code, no need to handle them here. */
+ MEM_SAFE_FREE(sima->scopes.waveform_1);
+ MEM_SAFE_FREE(sima->scopes.waveform_2);
+ MEM_SAFE_FREE(sima->scopes.waveform_3);
+ MEM_SAFE_FREE(sima->scopes.vecscope);
#endif
- sima->scopes.ok = 0;
-
- /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
- * so assume that here we're doing for undo only...
- */
- sima->gpd = restore_pointer_by_name(id_map, (ID *)sima->gpd, USER_REAL);
- sima->mask_info.mask = restore_pointer_by_name(id_map, (ID *)sima->mask_info.mask, USER_REAL);
- }
- else if (sl->spacetype == SPACE_SEQ) {
- SpaceSeq *sseq = (SpaceSeq *)sl;
-
- /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
- * so assume that here we're doing for undo only...
- */
- sseq->gpd = restore_pointer_by_name(id_map, (ID *)sseq->gpd, USER_REAL);
- }
- else if (sl->spacetype == SPACE_NLA) {
- SpaceNla *snla = (SpaceNla *)sl;
- bDopeSheet *ads = snla->ads;
-
- if (ads) {
- ads->source = restore_pointer_by_name(id_map, (ID *)ads->source, USER_REAL);
-
- if (ads->filter_grp)
- ads->filter_grp = restore_pointer_by_name(id_map, (ID *)ads->filter_grp, USER_IGNORE);
+ sima->scopes.ok = 0;
+
+ /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
+ * so assume that here we're doing for undo only...
+ */
+ sima->gpd = restore_pointer_by_name(id_map, (ID *)sima->gpd, USER_REAL);
+ sima->mask_info.mask = restore_pointer_by_name(id_map, (ID *)sima->mask_info.mask, USER_REAL);
}
- }
- else if (sl->spacetype == SPACE_TEXT) {
- SpaceText *st = (SpaceText *)sl;
-
- st->text = restore_pointer_by_name(id_map, (ID *)st->text, USER_REAL);
- if (st->text == NULL) st->text = newmain->text.first;
- }
- else if (sl->spacetype == SPACE_SCRIPT) {
- SpaceScript *scpt = (SpaceScript *)sl;
-
- scpt->script = restore_pointer_by_name(id_map, (ID *)scpt->script, USER_REAL);
-
- /*sc->script = NULL; - 2.45 set to null, better re-run the script */
- if (scpt->script) {
- SCRIPT_SET_NULL(scpt->script);
+ else if (sl->spacetype == SPACE_SEQ) {
+ SpaceSeq *sseq = (SpaceSeq *)sl;
+
+ /* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data
+ * so assume that here we're doing for undo only...
+ */
+ sseq->gpd = restore_pointer_by_name(id_map, (ID *)sseq->gpd, USER_REAL);
}
- }
- else if (sl->spacetype == SPACE_OUTLINER) {
- SpaceOops *so= (SpaceOops *)sl;
-
- so->search_tse.id = restore_pointer_by_name(id_map, so->search_tse.id, USER_IGNORE);
-
- if (so->treestore) {
- TreeStoreElem *tselem;
- BLI_mempool_iter iter;
-
- BLI_mempool_iternew(so->treestore, &iter);
- while ((tselem = BLI_mempool_iterstep(&iter))) {
- /* Do not try
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list