SOLVED Make EditingTool select only certain objects
I'm creating a tool for mark positioning and I want to only select anchors while the tool is active. Sometimes points and anchors overlap in position. I can make it based on
BaseEventToolbut then I have to create more methods to select and move the anchors which already exist in
EditingTool. It would be cool if
EditingToolonly accepted anchors for selection so I don't accidentally select other objects. This way I don't have to reinvent methods that already exist.
At the end, I made all the methods from scratch. After publishing I will post the link here.
This could idd be handy to have flags in a the
EditingToolto allow to select/edit specific objects, like on curves, off curves, anchors, guidelines, image, components...
In the next beta and release an subclass of an EditingTool could overwrite:
from mojo.events import EditingTool class MyTool(EditingTool): def canSelectAnchors(self): return True def canSelectImage(self): return False def canSelectComponents(self): return False def canSelectGuidelines(self): return False def canSelectPoints(self): return False def canSelectSidebearing(self): return False
Thank you very much Frederik, this is very useful!