[Bf-blender-cvs] [300c64299c8] greasepencil-refactor: Merge branch 'greasepencil-object' into greasepencil-refactor

Antonio Vazquez noreply at git.blender.org
Wed Feb 5 17:07:59 CET 2020


Commit: 300c64299c8f9e4add2b5b6d9cd5520bf3dbdd0c
Author: Antonio Vazquez
Date:   Wed Feb 5 17:07:43 2020 +0100
Branches: greasepencil-refactor
https://developer.blender.org/rB300c64299c8f9e4add2b5b6d9cd5520bf3dbdd0c

Merge branch 'greasepencil-object' into greasepencil-refactor

 Conflicts:
	source/blender/blenloader/intern/readfile.c
	source/blender/blenloader/intern/versioning_280.c

===================================================================



===================================================================

diff --cc source/blender/blenloader/intern/readfile.c
index e176415456e,4fba2c8b487..b89ca0bcbe5
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -7204,28 -6937,18 +6937,18 @@@ static void direct_link_scene(FileData 
   * \{ */
  
  /* relink's grease pencil data's refs */
- static void lib_link_gpencil(FileData *fd, Main *main)
+ static void lib_link_gpencil(FileData *fd, Main *UNUSED(bmain), bGPdata *gpd)
  {
    /* Relink all data-lock linked by GP data-lock */
-   for (bGPdata *gpd = main->gpencils.first; gpd; gpd = gpd->id.next) {
-     if (gpd->id.tag & LIB_TAG_NEED_LINK) {
-       /* Layers */
-       LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
-         /* Layer -> Parent References */
-         gpl->parent = newlibadr(fd, gpd->id.lib, gpl->parent);
-       }
- 
-       /* Data-block Stuff */
-       IDP_LibLinkProperty(gpd->id.properties, fd);
-       lib_link_animdata(fd, &gpd->id, gpd->adt);
- 
-       /* materials */
-       for (int a = 0; a < gpd->totcol; a++) {
-         gpd->mat[a] = newlibadr_us(fd, gpd->id.lib, gpd->mat[a]);
-       }
+   /* Layers */
 -  for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
++    LISTBASE_FOREACH(bGPDlayer*, gpl, &gpd->layers) {
+     /* Layer -> Parent References */
+     gpl->parent = newlibadr(fd, gpd->id.lib, gpl->parent);
+   }
  
-       gpd->id.tag &= ~LIB_TAG_NEED_LINK;
-     }
+   /* materials */
+   for (int a = 0; a < gpd->totcol; a++) {
+     gpd->mat[a] = newlibadr_us(fd, gpd->id.lib, gpd->mat[a]);
    }
  }
  
diff --cc source/blender/blenloader/intern/versioning_280.c
index 8468533d633,8ff82407e1c..ff5b98d13a4
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@@ -14,11 -14,11 +14,11 @@@
   * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
   */
  
--/** \file
-- * \ingroup blenloader
-- */
++ /** \file
++  * \ingroup blenloader
++  */
  
--/* allow readfile to use deprecated functionality */
++  /* allow readfile to use deprecated functionality */
  #define DNA_DEPRECATED_ALLOW
  
  #include <string.h>
@@@ -72,8 -71,8 +72,9 @@@
  #include "BKE_customdata.h"
  #include "BKE_fcurve.h"
  #include "BKE_freestyle.h"
+ #include "BKE_global.h"
  #include "BKE_gpencil.h"
 +#include "BKE_gpencil_modifier.h"
  #include "BKE_idprop.h"
  #include "BKE_key.h"
  #include "BKE_library.h"
@@@ -107,73 -106,73 +108,73 @@@
  /* Make preferences read-only, use versioning_userdef.c. */
  #define U (*((const UserDef *)&U))
  
--static bScreen *screen_parent_find(const bScreen *screen)
++static bScreen* screen_parent_find(const bScreen* screen)
  {
--  /* Can avoid lookup if screen state isn't maximized/full
--   * (parent and child store the same state). */
--  if (ELEM(screen->state, SCREENMAXIMIZED, SCREENFULL)) {
--    for (const ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
--      if (sa->full && sa->full != screen) {
--        BLI_assert(sa->full->state == screen->state);
--        return sa->full;
--      }
--    }
--  }
--
--  return NULL;
++	/* Can avoid lookup if screen state isn't maximized/full
++	 * (parent and child store the same state). */
++	if (ELEM(screen->state, SCREENMAXIMIZED, SCREENFULL)) {
++		for (const ScrArea* sa = screen->areabase.first; sa; sa = sa->next) {
++			if (sa->full && sa->full != screen) {
++				BLI_assert(sa->full->state == screen->state);
++				return sa->full;
++			}
++		}
++	}
++
++	return NULL;
  }
  
--static void do_version_workspaces_create_from_screens(Main *bmain)
++static void do_version_workspaces_create_from_screens(Main* bmain)
  {
--  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
--    const bScreen *screen_parent = screen_parent_find(screen);
--    WorkSpace *workspace;
--    if (screen->temp) {
--      continue;
--    }
--
--    if (screen_parent) {
--      /* Full-screen with "Back to Previous" option, don't create
--       * a new workspace, add layout workspace containing parent. */
--      workspace = BLI_findstring(
--          &bmain->workspaces, screen_parent->id.name + 2, offsetof(ID, name) + 2);
--    }
--    else {
--      workspace = BKE_workspace_add(bmain, screen->id.name + 2);
--    }
--    if (workspace == NULL) {
--      continue; /* Not much we can do.. */
--    }
--    BKE_workspace_layout_add(bmain, workspace, screen, screen->id.name + 2);
--  }
++	for (bScreen* screen = bmain->screens.first; screen; screen = screen->id.next) {
++		const bScreen* screen_parent = screen_parent_find(screen);
++		WorkSpace* workspace;
++		if (screen->temp) {
++			continue;
++		}
++
++		if (screen_parent) {
++			/* Full-screen with "Back to Previous" option, don't create
++			 * a new workspace, add layout workspace containing parent. */
++			workspace = BLI_findstring(
++				&bmain->workspaces, screen_parent->id.name + 2, offsetof(ID, name) + 2);
++		}
++		else {
++			workspace = BKE_workspace_add(bmain, screen->id.name + 2);
++		}
++		if (workspace == NULL) {
++			continue; /* Not much we can do.. */
++		}
++		BKE_workspace_layout_add(bmain, workspace, screen, screen->id.name + 2);
++	}
  }
  
--static void do_version_area_change_space_to_space_action(ScrArea *area, const Scene *scene)
++static void do_version_area_change_space_to_space_action(ScrArea* area, const Scene* scene)
  {
--  SpaceType *stype = BKE_spacetype_from_id(SPACE_ACTION);
--  SpaceAction *saction = (SpaceAction *)stype->new (area, scene);
--  ARegion *region_channels;
--
--  /* Properly free current regions */
--  for (ARegion *region = area->regionbase.first; region; region = region->next) {
--    BKE_area_region_free(area->type, region);
--  }
--  BLI_freelistN(&area->regionbase);
--
--  area->type = stype;
--  area->spacetype = stype->spaceid;
--
--  BLI_addhead(&area->spacedata, saction);
--  area->regionbase = saction->regionbase;
--  BLI_listbase_clear(&saction->regionbase);
--
--  /* Different defaults for timeline */
--  region_channels = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
--  region_channels->flag |= RGN_FLAG_HIDDEN;
--
--  saction->mode = SACTCONT_TIMELINE;
--  saction->ads.flag |= ADS_FLAG_SUMMARY_COLLAPSED;
--  saction->ads.filterflag |= ADS_FILTER_SUMMARY;
++	SpaceType* stype = BKE_spacetype_from_id(SPACE_ACTION);
++	SpaceAction* saction = (SpaceAction*)stype->new (area, scene);
++	ARegion* region_channels;
++
++	/* Properly free current regions */
++	for (ARegion* region = area->regionbase.first; region; region = region->next) {
++		BKE_area_region_free(area->type, region);
++	}
++	BLI_freelistN(&area->regionbase);
++
++	area->type = stype;
++	area->spacetype = stype->spaceid;
++
++	BLI_addhead(&area->spacedata, saction);
++	area->regionbase = saction->regionbase;
++	BLI_listbase_clear(&saction->regionbase);
++
++	/* Different defaults for timeline */
++	region_channels = BKE_area_find_region_type(area, RGN_TYPE_CHANNELS);
++	region_channels->flag |= RGN_FLAG_HIDDEN;
++
++	saction->mode = SACTCONT_TIMELINE;
++	saction->ads.flag |= ADS_FLAG_SUMMARY_COLLAPSED;
++	saction->ads.filterflag |= ADS_FILTER_SUMMARY;
  }
  
  /**
@@@ -188,1937 -187,1961 +189,1961 @@@
   * \note Some of the created workspaces might be deleted again
   * in case of reading the default `startup.blend`.
   */
--static void do_version_workspaces_after_lib_link(Main *bmain)
++static void do_version_workspaces_after_lib_link(Main* bmain)
  {
--  BLI_assert(BLI_listbase_is_empty(&bmain->workspaces));
--
--  do_version_workspaces_create_from_screens(bmain);
--
--  for (wmWindowManager *wm = bmain->wm.first; wm; wm = wm->id.next) {
--    for (wmWindow *win = wm->windows.first; win; win = win->next) {
--      bScreen *screen_parent = screen_parent_find(win->screen);
--      bScreen *screen = screen_parent ? screen_parent : win->screen;
--
--      if (screen->temp) {
--        /* We do not generate a new workspace for those screens...
--         * still need to set some data in win. */
--        win->workspace_hook = BKE_workspace_instance_hook_create(bmain);
--        win->scene = screen->scene;
--        /* Deprecated from now on! */
--        win->screen = NULL;
--        continue;
--      }
--
--      WorkSpace *workspace = BLI_findstring(
--          &bmain->workspaces, screen->id.name + 2, offsetof(ID, name) + 2);
--      BLI_assert(workspace != NULL);
--      WorkSpaceLayout *layout = BKE_workspace_layout_find(workspace, win->screen);
--      BLI_assert(layout != NULL);
--
--      win->workspace_hook = BKE_workspace_instance_hook_create(bmain);
--
--      BKE_workspace_active_set(win->workspace_hook, workspace);
--      BKE_workspace_active_layout_set(win->workspace_hook, layout);
--
--      /* Move scene and view layer to window. */
--      Scene *scene = screen->scene;
--      ViewLayer *layer = BLI_findlink(&scene->view_layers, scene->r.actlay);
--      if (!layer) {
--        layer = BKE_view_layer_default_view(scene);
--      }
--
--      win->scene = scene;
--      STRNCPY(win->view_layer_name, layer->name);
--
--      /* Deprecated from now on! */
--      win->screen = NULL;
--    }
--  }
--
--  for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
--    /* Deprecated from now on! */
--    BLI_freelistN(&screen->scene->transform_spaces);
--    screen->scene = NULL;
--  }
++	BLI_assert(BLI_listbase_is_empty(&bmain->workspaces));
++
++	do_version_workspaces_create_from_screens(bmain);
++
++	for (wmWindowManager* wm = bmain->wm.first; wm; wm = wm->id.next) {
++		for (wmWindow* win = wm->windows.first; win; win = win->next) {
++			bScreen* screen_parent = screen_parent_find(win->screen);
++			bScreen* screen = screen_parent ? screen_parent : win->screen;
++
++			if (screen->temp) {
++				/* We do not generate a new workspace for those screens...
++				 * still need to set some data in win. */
++				win->workspace_hook = BKE_workspace_instance_hook_create(bmain);
++				win->scene = screen->scene;
++				/* Deprecated from now on! */
++				win->screen = NULL;
++				continue;
++			}
++
++			WorkSpace* workspace = BLI_findstring(
++				&bmain->workspaces, screen->id.name + 2, offsetof(ID, name) + 2);
++			BLI_assert(workspace != NULL);
++			WorkSpaceLa

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list