Page MenuHome

Fix T57149: Measures are referred to as annotation layers but are not deleted when removing the layer.

Authored by Antonio Vazquez (antoniov) on Sat, May 16, 11:21 AM.



This is a proposed fix that removes any relationship with annotations and ruler because it looks this code was obsolete.

Diff Detail

Event Timeline

It's fine with me.

But I never understood this relation between rulers and annotations, so would like @Campbell Barton (campbellbarton) to give his opinion before this is committed.

Campbell Barton (campbellbarton) requested changes to this revision.EditedTue, May 19, 5:54 AM

The code is still used, applying this patch means rules aren't saved for reuse anymore.

This is easy to test, add some rulers, save the file and reload.

Using grease pencil for rulers is a bit weak, so these could be moved into their own data-structures.

This revision now requires changes to proceed.Tue, May 19, 5:54 AM

@Campbell Barton (campbellbarton) and is it GPencil datablock the place to save this? IMHO it looks weird use this..I know is a trick, but not the most elegant solution. If we add more things to annotations to support texts and other functionalities, we will have all the time this hack, and in the future this is only a source of problems.

Maybe the right place would be to add a listbase to Scene struct to save this data and split rulers from Annotations and GPencil. If all agree, I could try to do it.

Agree it's strange, it was a quick way to rules as store an arbitrary number of 2-3 point lines.

I wanted to avoid some overhead, consider having to add DNA/RNA, along with RNA functions to add/remove rulers.

Although we could just have DNA and not worry about RNA access, this is the kind of thing people might eventually want a Python API for.

We need a totally different aproach here, so close this patch.