kateliev/TypeRig

pGlyph > Layer Mark Issue

Closed this issue · 5 comments

Vassil, please take a look at this line:

self.layers(layer).mark = mark_color

I think it must be replaced by

self.layer(layer).mark = mark_color

to make the code work. Try to set a layer-specific flag with the method, and you will get an error. Thank you for looking into this.

@alex-phil Yes you are totally right! Fixed! Thank you Alex!

Vassil, I just wanted to make sure whether this was intended. With the current setup of the function, setMark() will set layer-specific flags only. Since you removed the if-else structure from the function code, setting glyph-specific flags now seems to require iterating over all layers of a glyph and applying setMark() to each of them. Which might raise issues with backwards compatibility of existing scripts that use setMark().

def setMark(self, mark_color, layer=None):
  if layer is None:
    self.fl.mark = self.mark = mark_color
  else:
    self.layer(layer).mark = mark_color

Good question @alex-phil! Will investigate... i have some strange feeling that the global flGlyph.mark was actually not working ...

I just checked, @kateliev. We can use

from typerig.proxy.fl.objects.glyph import *
pGlyph().mark = 100

to set the glyph-specific flag for the current glyph to 100. So the global flGlyph.mark seems to be working.

@alex-phil fixed! Thank you!