Commit: 31066ef234484db78e5b88e2f835a6720d679b22
Author: Antonioya
Date:   Mon Apr 8 17:22:48 2019 +0200
Branches: greasepencil-object
https://developer.blender.org/rB31066ef234484db78e5b88e2f835a6720d679b22

GPencil: Fix stroke opacity initialization

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

M       source/blender/blenloader/intern/versioning_280.c

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

diff --git a/source/blender/blenloader/intern/versioning_280.c 
b/source/blender/blenloader/intern/versioning_280.c
index 028a9eb8428..ae525c8339f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2944,32 +2944,6 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
                        }
                } FOREACH_NODETREE_END;
 
-               /* init grease pencil brush gradients */
-               if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", 
"float", "gradient_f")) {
-                       for (Brush *brush = bmain->brushes.first; brush; brush 
= brush->id.next) {
-                               if (brush->gpencil_settings != NULL) {
-                                       BrushGpencilSettings *gp = 
brush->gpencil_settings;
-                                       gp->gradient_f = 1.0f;
-                                       gp->gradient_s[0] = 1.0f;
-                                       gp->gradient_s[1] = 1.0f;
-                               }
-                       }
-               }
-
-               /* init grease pencil stroke gradients */
-               if (!DNA_struct_elem_find(fd->filesdna, "bGPDstroke", "float", 
"gradient_f")) {
-                       for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = 
gpd->id.next) {
-                               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) {
-                                                       gps->gradient_f = 1.0f;
-                                                       gps->gradient_s[0] = 
1.0f;
-                                                       gps->gradient_s[1] = 
1.0f;
-                                               }
-                                       }
-                               }
-                       }
-               }
        }
 
        if (!MAIN_VERSION_ATLEAST(bmain, 280, 53)) {
@@ -3048,5 +3022,33 @@ void blo_do_versions_280(FileData *fd, Library 
*UNUSED(lib), Main *bmain)
                                }
                        }
                }
+
+               /* init grease pencil brush gradients */
+               if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", 
"float", "gradient_f")) {
+                       for (Brush *brush = bmain->brushes.first; brush; brush 
= brush->id.next) {
+                               if (brush->gpencil_settings != NULL) {
+                                       BrushGpencilSettings *gp = 
brush->gpencil_settings;
+                                       gp->gradient_f = 1.0f;
+                                       gp->gradient_s[0] = 1.0f;
+                                       gp->gradient_s[1] = 1.0f;
+                               }
+                       }
+               }
+
+               /* init grease pencil stroke gradients */
+               if (!DNA_struct_elem_find(fd->filesdna, "bGPDstroke", "float", 
"gradient_f")) {
+                       for (bGPdata *gpd = bmain->gpencils.first; gpd; gpd = 
gpd->id.next) {
+                               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) {
+                                                       gps->gradient_f = 1.0f;
+                                                       gps->gradient_s[0] = 
1.0f;
+                                                       gps->gradient_s[1] = 
1.0f;
+                                               }
+                                       }
+                               }
+                       }
+               }
+
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to