[Bf-blender-cvs] [e1abb1b6aee] greasepencil-object: GPencil: Only init materials for 2D template

Antonio Vazquez noreply at git.blender.org
Sat Mar 7 11:54:41 CET 2020


Commit: e1abb1b6aeef280a503919fd554c5293158c9c06
Author: Antonio Vazquez
Date:   Sat Mar 7 11:54:14 2020 +0100
Branches: greasepencil-object
https://developer.blender.org/rBe1abb1b6aeef280a503919fd554c5293158c9c06

GPencil: Only init materials for 2D template

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

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

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

diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index 03cb9da8224..f0127330b1b 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -628,30 +628,32 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
     }
 
     /* Rename and fix materials. */
-    Material *ma = NULL;
-    rename_id_for_versioning(bmain, ID_MA, "Black", "Solid Stroke");
-    rename_id_for_versioning(bmain, ID_MA, "Red", "Squares Stroke");
-    rename_id_for_versioning(bmain, ID_MA, "Grey", "Solid Fill");
-    rename_id_for_versioning(bmain, ID_MA, "Black Dots", "Dots Stroke");
-
-    /* Dots Stroke. */
-    ma = BLI_findstring(&bmain->materials, "Dots Stroke", offsetof(ID, name) + 2);
-    if (ma == NULL) {
-      ma = BKE_gpencil_material_add(bmain, "Dots Stroke");
-    }
-    ma->gp_style->mode = GP_MATERIAL_MODE_DOT;
-
-    /* Squares Stroke. */
-    ma = BLI_findstring(&bmain->materials, "Squares Stroke", offsetof(ID, name) + 2);
-    if (ma == NULL) {
-      ma = BKE_gpencil_material_add(bmain, "Squares Stroke");
-    }
-    ma->gp_style->mode = GP_MATERIAL_MODE_SQUARE;
-
-    /* Change Solid Fill settings. */
-    ma = BLI_findstring(&bmain->materials, "Solid Fill", offsetof(ID, name) + 2);
-    if (ma != NULL) {
-      ma->gp_style->flag &= ~GP_MATERIAL_STROKE_SHOW;
+    if (app_template && STREQ(app_template, "2D_Animation")) {
+      Material *ma = NULL;
+      rename_id_for_versioning(bmain, ID_MA, "Black", "Solid Stroke");
+      rename_id_for_versioning(bmain, ID_MA, "Red", "Squares Stroke");
+      rename_id_for_versioning(bmain, ID_MA, "Grey", "Solid Fill");
+      rename_id_for_versioning(bmain, ID_MA, "Black Dots", "Dots Stroke");
+
+      /* Dots Stroke. */
+      ma = BLI_findstring(&bmain->materials, "Dots Stroke", offsetof(ID, name) + 2);
+      if (ma == NULL) {
+        ma = BKE_gpencil_material_add(bmain, "Dots Stroke");
+      }
+      ma->gp_style->mode = GP_MATERIAL_MODE_DOT;
+
+      /* Squares Stroke. */
+      ma = BLI_findstring(&bmain->materials, "Squares Stroke", offsetof(ID, name) + 2);
+      if (ma == NULL) {
+        ma = BKE_gpencil_material_add(bmain, "Squares Stroke");
+      }
+      ma->gp_style->mode = GP_MATERIAL_MODE_SQUARE;
+
+      /* Change Solid Fill settings. */
+      ma = BLI_findstring(&bmain->materials, "Solid Fill", offsetof(ID, name) + 2);
+      if (ma != NULL) {
+        ma->gp_style->flag &= ~GP_MATERIAL_STROKE_SHOW;
+      }
     }
 
     /* Reset all grease pencil brushes. */



More information about the Bf-blender-cvs mailing list