Mainstreet

Hello,
I'm pleased to announce an alpha release of a new Krita plugin to export Spine files, available here. Heavily inspired and borrowing code from Chartinger's Krita plugin, expanded with new features such as image scale on export. This is alpha code is working well, bug reports and such welcome. Features

  1. Change scale, canvas size or rotate on export
  2. Choose from available documents, allowing dialog to stay visible and export multiple files in one session
  3. Automatic setting of output directory and width/height parameters
  4. Supports bone, slot, merge and ignore tags for groups.

Todo
  1. Working on setting origin via Guides
  2. Support multiple transforms on output
  3. Support skins
  4. Persistent settings saving, such as relative output directory

Bugs
  1. Choosing the Document sets the parameters only on the shown transform tab

Screenshot

Capture.PNG
이 게시글에 첨부된 파일을 보기위한 권한을 요청할 수 없습니다.
Mainstreet
  • 전체글: 5

Mario

Awesome!
사용자 아바타
Mario

Mario
  • 전체글: 2721

Harald

This is great, thanks for sharing!
사용자 아바타
Harald

Harri
  • 전체글: 3457

Bipolar

Thank you!
I can now cancel my Creative Cloud monthly payment.<3
Does it work with Krita 3 too?
Bipolar
  • 전체글: 20

Erika

The plug in here also offers tags like the photoshop plugin: Krita export plugin it would be amazing if it was en-par with the PhotoshopToSpine script :D spine-scripts/photoshop at master · EsotericSoftware/spine-scripts
사용자 아바타
Erika

Erikari
  • 전체글: 2980

Masterio

Krita 4.2.1 has an error: ... Not enough arguments...

Fix:

Add the import in file SpineExport.py
from krita import InfoObject
next change the method parameters:

from:
child.save(layer_file_name, 96, 96)
to:
child.save(layer_file_name, 96, 96, InfoObject())
Masterio
  • 전체글: 9

Darko

Really looking forward to progress in this plugin as this would simplify my work flow by cutting out the photoshop middle man :bigeye:
Darko
  • 전체글: 2

Nick

Tried copy the folder and .desktop to the pykrita folder and but the export option does not show up in the menu.
Does the script not work in the latest Krita version
Nick
  • 전체글: 274

neodymium

It's a great plugin but I'm having a problem. krita v4.4.8 is giving me an error and not exporting.

Is there anything I can read from the error message?
TypeError
Python 3.8.1: E:\Steam\steamapps\common\Krita\krita\bin\krita.exe
Sat Oct 2 15:41:51 2021

A problem occurred in a Python script. Here is the sequence of
function calls leading up to the error, in the order they occurred.

C:\Users\kingn\AppData\Roaming\krita\pykrita\KritaToSpine\uidocumenttools.py in confirmButton(self=<KritaToSpine.uidocumenttools.UIDocumentTools object>)
126 widget.adjust(cloneDoc)
127 # Save the json from the clone
128 self.spineExport.exportDocument(cloneDoc, self.directoryTextField.text())
129 # Clone no longer needed
130 cloneDoc.close()
self = <KritaToSpine.uidocumenttools.UIDocumentTools object>
self.spineExport = <KritaToSpine.SpineExport.SpineExport object>
self.spineExport.exportDocument = <bound method SpineExport.exportDocument of <KritaToSpine.SpineExport.SpineExport object>>
cloneDoc = <PyKrita.krita.Document object>
self.directoryTextField = <PyQt5.QtWidgets.QLineEdit object>
self.directoryTextField.text = <built-in method text of QLineEdit object>

C:\Users\kingn\AppData\Roaming\krita\pykrita\KritaToSpine\SpineExport.py in exportDocument(self=<KritaToSpine.SpineExport.SpineExport object>, document=<PyKrita.krita.Document object>, directory='D:/video/factory workers/Stream/img/alert/spine')
41 Krita.instance().setBatchmode(True)
42 self.document = document
43 self._export(document.rootNode(), directory)
44 Krita.instance().setBatchmode(False)
45 with open('{0}/{1}'.format(directory, 'spine.json'), 'w') as outfile:
self = <KritaToSpine.SpineExport.SpineExport object>
self._export = <bound method SpineExport._export of <KritaToSpine.SpineExport.SpineExport object>>
document = <PyKrita.krita.Document object>
document.rootNode = <built-in method rootNode of Document object>
directory = 'D:/video/factory workers/Stream/img/alert/spine'

C:\Users\kingn\AppData\Roaming\krita\pykrita\KritaToSpine\SpineExport.py in _export(self=<KritaToSpine.SpineExport.SpineExport object>, node=<PyKrita.krita.GroupLayer object>, directory='D:/video/factory workers/Stream/img/alert/spine', bone='root', xOffset=0, yOffset=0, slot=None)
111 name = self.mergePattern.sub('', child.name()).strip()
112 layer_file_name = '{0}/{1}.{2}'.format(directory, name, self.fileFormat)
113 child.save(layer_file_name, 96, 96)
114
115 newSlot = slot
child = <PyKrita.krita.Node object>
child.save = <built-in method save of Node object>
layer_file_name = 'D:/video/factory workers/Stream/img/alert/spine/back_hair.png'
TypeError: save(self, str, float, float, InfoObject, QRect = QRect()): not enough arguments
__cause__ = None
__class__ = <class 'TypeError'>
__context__ = None
__delattr__ = <method-wrapper '__delattr__' of TypeError object>
__dict__ = {}
__dir__ = <built-in method __dir__ of TypeError object>
__doc__ = 'Inappropriate argument type.'
__eq__ = <method-wrapper '__eq__' of TypeError object>
__format__ = <built-in method __format__ of TypeError object>
__ge__ = <method-wrapper '__ge__' of TypeError object>
__getattribute__ = <method-wrapper '__getattribute__' of TypeError object>
__gt__ = <method-wrapper '__gt__' of TypeError object>
__hash__ = <method-wrapper '__hash__' of TypeError object>
__init__ = <method-wrapper '__init__' of TypeError object>
__init_subclass__ = <built-in method __init_subclass__ of type object>
__le__ = <method-wrapper '__le__' of TypeError object>
__lt__ = <method-wrapper '__lt__' of TypeError object>
__ne__ = <method-wrapper '__ne__' of TypeError object>
__new__ = <built-in method __new__ of type object>
__reduce__ = <built-in method __reduce__ of TypeError object>
__reduce_ex__ = <built-in method __reduce_ex__ of TypeError object>
__repr__ = <method-wrapper '__repr__' of TypeError object>
__setattr__ = <method-wrapper '__setattr__' of TypeError object>
__setstate__ = <built-in method __setstate__ of TypeError object>
__sizeof__ = <built-in method __sizeof__ of TypeError object>
__str__ = <method-wrapper '__str__' of TypeError object>
__subclasshook__ = <built-in method __subclasshook__ of type object>
__suppress_context__ = False
__traceback__ = <traceback object>
args = ('save(self, str, float, float, InfoObject, QRect = QRect()): not enough arguments',)
with_traceback = <built-in method with_traceback of TypeError object>

The above is a description of an error in a Python program. Here is
the original traceback:

Traceback (most recent call last):
File "C:\Users\kingn\AppData\Roaming\krita\pykrita\KritaToSpine\uidocumenttools.py", line 128, in confirmButton
self.spineExport.exportDocument(cloneDoc, self.directoryTextField.text())
File "C:\Users\kingn\AppData\Roaming\krita\pykrita\KritaToSpine\SpineExport.py", line 43, in exportDocument
self._export(document.rootNode(), directory)
File "C:\Users\kingn\AppData\Roaming\krita\pykrita\KritaToSpine\SpineExport.py", line 113, in _export
child.save(layer_file_name, 96, 96)
TypeError: save(self, str, float, float, InfoObject, QRect = QRect()): not enough arguments
사용자 아바타
neodymium
  • 전체글: 2

mulot

Hello,
Is there any chance that the plugin will support skins soon ?

Thank you very much ! :)
mulot
  • 전체글: 6


다시 돌아감: Editor