Fix T63455: Legacy GPencil settings in Annotations

This commit is contained in:
Antonio Vazquez 2019-04-10 11:31:37 +02:00
parent f9e0836147
commit 99f1e3d57f
Notes: blender-bot 2023-02-21 17:59:30 +01:00
Referenced by issue #63455, Legacy GPencil settings in Annotations
2 changed files with 15 additions and 0 deletions

View File

@ -571,6 +571,14 @@ static void do_versions_fix_annotations(bGPdata *gpd)
for (bGPDpalettecolor *palcolor = palette->colors.first; palcolor; palcolor = palcolor->next) {
/* fix layers */
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
/* unlock/unhide layer */
gpl->flag &= ~GP_LAYER_LOCKED;
gpl->flag &= ~GP_LAYER_HIDE;
/* set opacity to 1 */
gpl->opacity = 1.0f;
/* disable tint */
gpl->tintcolor[3] = 0.0f;
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') &&

View File

@ -170,6 +170,13 @@ static int gpencil_convert_old_files_exec(bContext *C, wmOperator *op)
for (bGPDpalettecolor *palcolor = palette->colors.first; palcolor; palcolor = palcolor->next) {
/* fix layers */
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
/* unlock/unhide layer */
gpl->flag &= ~GP_LAYER_LOCKED;
gpl->flag &= ~GP_LAYER_HIDE;
/* set opacity to 1 */
gpl->opacity = 1.0f;
/* disable tint */
gpl->tintcolor[3] = 0.0f;
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') &&