GPencil: Enable Lights ON to default object in 2D template

This commit is contained in:
Antonio Vazquez 2020-03-13 13:05:24 +01:00
parent 9075ec8269
commit 4326d162ba
1 changed files with 6 additions and 1 deletions

View File

@ -627,7 +627,7 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
BKE_id_delete(bmain, brush);
}
/* Rename and fix materials. */
/* Rename and fix materials and enable default object lights on. */
if (app_template && STREQ(app_template, "2D_Animation")) {
Material *ma = NULL;
rename_id_for_versioning(bmain, ID_MA, "Black", "Solid Stroke");
@ -654,6 +654,11 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
if (ma != NULL) {
ma->gp_style->flag &= ~GP_MATERIAL_STROKE_SHOW;
}
Object *ob = BLI_findstring(&bmain->objects, "Stroke", offsetof(ID, name) + 2);
if (ob && ob->type == OB_GPENCIL) {
ob->dtx |= OB_USE_GPENCIL_LIGHTS;
}
}
/* Reset all grease pencil brushes. */