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:
authorAntonioya <blendergit@gmail.com>2019-04-09 21:12:21 +0300
committerAntonioya <blendergit@gmail.com>2019-04-09 21:12:21 +0300
commit009dbc2bc9fbd45f974b46835679fefae7b42561 (patch)
tree2e5598abbb7fa72685d5234b2951b6416d000d28 /source/blender/blenloader
parent59955a297ed955d022f3c76374091a824cfe2e6c (diff)
Fix T63427: Annotations don'twork with 2.79 settings
The problem was the colors were not converted and the annotation flag was not enabled. Note: For Scene data (View3D) there is a convert operator.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_280.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index a32ff9f5ef0..6eeb70c3e16 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -564,6 +564,28 @@ static void do_version_collection_propagate_lib_to_children(Collection *collecti
}
}
+/** convert old annotations colors */
+static void do_versions_fix_annotations(bGPdata *gpd)
+{
+ for (const bGPDpalette *palette = gpd->palettes.first; palette; palette = palette->next) {
+ for (bGPDpalettecolor *palcolor = palette->colors.first; palcolor; palcolor = palcolor->next) {
+ /* fix layers */
+ for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+ for (bGPDframe *gpf = gpl->frames.first; gpf; gpf = gpf->next) {
+ for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
+ if ((gps->colorname[0] != '\0') &&
+ (STREQ(gps->colorname, palcolor->info)))
+ {
+ /* copy color settings */
+ copy_v4_v4(gpl->color, palcolor->color);
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
void do_versions_after_linking_280(Main *bmain)
{
bool use_collection_compat_28 = true;
@@ -657,6 +679,30 @@ void do_versions_after_linking_280(Main *bmain)
}
}
+ if (!MAIN_VERSION_ATLEAST(bmain, 280, 0)) {
+ for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) {
+ for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+ for (SpaceLink *space = sa->spacedata.first; space; space = space->next) {
+ if (space->spacetype == SPACE_IMAGE) {
+ SpaceImage *sima = (SpaceImage *)space;
+ if ((sima) && (sima->gpd)) {
+ sima->gpd->flag |= GP_DATA_ANNOTATIONS;
+ do_versions_fix_annotations(sima->gpd);
+ }
+ }
+ if (space->spacetype == SPACE_CLIP) {
+ SpaceClip *spclip = (SpaceClip *)space;
+ MovieClip *clip = spclip->clip;
+ if ((clip) && (clip->gpd)) {
+ clip->gpd->flag |= GP_DATA_ANNOTATIONS;
+ do_versions_fix_annotations(clip->gpd);
+ }
+ }
+ }
+ }
+ }
+ }
+
/* New workspace design */
if (!MAIN_VERSION_ATLEAST(bmain, 280, 1)) {
do_version_workspaces_after_lib_link(bmain);