Remember plugin setting

Hi, Is there a way to save a plugin variable, for example an string, or a checkbox status within the current document? The idea is to reopen the kra file and remember my plugin settings.
Thanks!

Hi

I provided an answer about this question yesterday :slight_smile:

Grum999

2 Likes

thanks for your fast response Grum999!
I tried your solution but failed with these errors:

  • Document object has no attribute "setAnnotation "
  • Document object has no attribute “annotationTypes”

Is strange because the documentation does refer to them…
This is the dir(Krita.instance().activeDocument())

[‘class’, ‘delattr’, ‘dict’, ‘dir’, ‘doc’, ‘eq’, ‘format’, ‘ge’, ‘getattr’, ‘getattribute’, ‘gt’, ‘hash’, ‘init’, ‘init_subclass’, ‘le’, ‘lt’, ‘module’, ‘ne’, ‘new’, ‘reduce’, ‘reduce_ex’, ‘repr’, ‘setattr’, ‘sizeof’, ‘str’, ‘subclasshook’, ‘weakref’, ‘activeNode’, ‘animationLength’, ‘backgroundColor’, ‘batchmode’, ‘blockSignals’, ‘bounds’, ‘childEvent’, ‘children’, ‘clone’, ‘close’, ‘colorDepth’, ‘colorModel’, ‘colorProfile’, ‘connectNotify’, ‘createCloneLayer’, ‘createFillLayer’, ‘createFilterLayer’, ‘createFilterMask’, ‘createGroupLayer’, ‘createNode’, ‘createSelectionMask’, ‘createVectorLayer’, ‘crop’, ‘currentTime’, ‘customEvent’, ‘deleteLater’, ‘destroyed’, ‘disconnect’, ‘disconnectNotify’, ‘documentInfo’, ‘dumpObjectInfo’, ‘dumpObjectTree’, ‘dynamicPropertyNames’, ‘event’, ‘eventFilter’, ‘exportImage’, ‘fileName’, ‘findChild’, ‘findChildren’, ‘flatten’, ‘framesPerSecond’, ‘fullClipRangeEndTime’, ‘fullClipRangeStartTime’, ‘guidesLocked’, ‘guidesVisible’, ‘height’, ‘horizontalGuides’, ‘importAnimation’, ‘inherits’, ‘installEventFilter’, ‘isSignalConnected’, ‘isWidgetType’, ‘isWindowType’, ‘killTimer’, ‘lock’, ‘metaObject’, ‘modified’, ‘moveToThread’, ‘name’, ‘nodeByName’, ‘objectName’, ‘objectNameChanged’, ‘parent’, ‘pixelData’, ‘playBackEndTime’, ‘playBackStartTime’, ‘projection’, ‘property’, ‘pyqtConfigure’, ‘receivers’, ‘refreshProjection’, ‘removeEventFilter’, ‘resizeImage’, ‘resolution’, ‘rootNode’, ‘rotateImage’, ‘save’, ‘saveAs’, ‘scaleImage’, ‘selection’, ‘sender’, ‘senderSignalIndex’, ‘setActiveNode’, ‘setBackgroundColor’, ‘setBatchmode’, ‘setColorProfile’, ‘setColorSpace’, ‘setCurrentTime’, ‘setDocumentInfo’, ‘setFileName’, ‘setFramesPerSecond’, ‘setFullClipRangeEndTime’, ‘setFullClipRangeStartTime’, ‘setGuidesLocked’, ‘setGuidesVisible’, ‘setHeight’, ‘setHorizontalGuides’, ‘setName’, ‘setObjectName’, ‘setParent’, ‘setPlayBackRange’, ‘setProperty’, ‘setResolution’, ‘setSelection’, ‘setVerticalGuides’, ‘setWidth’, ‘setXOffset’, ‘setXRes’, ‘setYOffset’, ‘setYRes’, ‘shearImage’, ‘signalsBlocked’, ‘startTimer’, ‘staticMetaObject’, ‘thread’, ‘thumbnail’, ‘timerEvent’, ‘topLevelNodes’, ‘tr’, ‘tryBarrierLock’, ‘unlock’, ‘verticalGuides’, ‘waitForDone’, ‘width’, ‘xOffset’, ‘xRes’, ‘yOffset’, ‘yRes’]

Could you help me?

Are you working with Krita 5?
Or Krita 4.4.x?

The annotation system exist only from Krita 5.
The API documentation has been updated to Krita 5 before Krita 5 final release has been released :slight_smile:

Grum999

1 Like

Thanks Grum999!!! Couldn’t do it without your help!