Page MenuHome

Anotations: Fix a several issues with stroke placement
ClosedPublic

Authored by Aaron Carlisle (Blendify) on Jul 26 2021, 5:17 AM.

Details

Summary

Previously, this option was not exposed in the UI, only for the clip editor.
There were also multiple rna properties that did the same thing for each of the 2D editors.

There was also an issue where the property enum items were the same as the 3d view which didnt make much sense.

Diff Detail

Repository
rB Blender

Event Timeline

Aaron Carlisle (Blendify) requested review of this revision.Jul 26 2021, 5:17 AM
Aaron Carlisle (Blendify) created this revision.

Good idea to share same settings...this was very old code.

To set the default placement, you could use this code:

diff --git a/source/blender/blenloader/intern/versioning_300.c b/source/blender/blenloader/intern/versioning_300.c
index 4dcb7414bb4..17db02567b5 100644
--- a/source/blender/blenloader/intern/versioning_300.c
+++ b/source/blender/blenloader/intern/versioning_300.c
@@ -663,6 +663,14 @@ void blo_do_versions_300(FileData *fd, Library *UNUSED(lib), Main *bmain)
         }
       }
     }
+
+    /* Set default 2D annotation placement. */
+    for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
+      ToolSettings *ts = scene->toolsettings;
+      // if (!DNA_struct_elem_find(fd->filesdna, "ToolSettings", "char", "gpencil_v2d_align")) {
+      ts->gpencil_v2d_align = GP_PROJECT_VIEWSPACE | GP_PROJECT_CURSOR;
+      //}
+    }
   }
 
   /**
Antonio Vazquez (antoniov) requested changes to this revision.Jul 26 2021, 5:52 PM
This revision now requires changes to proceed.Jul 26 2021, 5:52 PM
  • Add versioning code
This revision is now accepted and ready to land.Jul 26 2021, 11:28 PM