- Изменено
Announcement: New Krita export plugin for Spine
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
Change scale, canvas size or rotate on export
Choose from available documents, allowing dialog to stay visible and export multiple files in one session
Automatic setting of output directory and width/height parameters
Supports bone, slot, merge and ignore tags for groups.
Todo
Working on setting origin via Guides
Support multiple transforms on output
Support skins
Persistent settings saving, such as relative output directory
Bugs
Choosing the Document sets the parameters only on the shown transform tab
Screenshot
Awesome!
This is great, thanks for sharing!
Thank you!
I can now cancel my Creative Cloud monthly payment.<3
Does it work with Krita 3 too?
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 spine-scripts/photoshop at master · EsotericSoftware/spine-scripts
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())
Really looking forward to progress in this plugin as this would simplify my work flow by cutting out the photoshop middle man :bigeye:
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
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
Hello,
Is there any chance that the plugin will support skins soon ?
Thank you very much !
Hi. I have just started using Spine. But this plugin doesn't work with Krita 5.2.2, so I made a fix. I didn't delve into the results, so please let me know if you have any problems. I used the version DanStout/KritaToSpine which can work with [Skin] tag. I open a pull request, but now the patched version can be downloaded from my repository Savidiy/KritaToSpinetree/master.
Hello Savidiy
I'm glad to see that people still need to use this feature
I don't have so much time to try it, but thank you for the upload. I'll give a feedback when I use it
have a nice day
T.Fly() sorry, I think there is extra dot in the link above. Try this Savidiy/KritaToSpinetree/master
I've added a few improvements for exporting:
The selected width and height is saved.
When merging the pass-through checkbox is unchecked (in my case it fix black exported image)
The layer blending is passed to spine for Normal, Additive, Multiply and Screen variants.
Savidiy Would you be interested to do a pull request for spine scripts repo? EsotericSoftware/spine-scripts
More people should know they are not forced into the Adobe ecosystem to get all the relevant parts of the PhotoshopToSpine script functionality since no other script on there supports those features.
BTW, we are working on having the Spine editor process a PSD file itself. Most image editing software can write the PSD format, so this will break us free from the nasty Adobe products. We already have this working but it isn't finished. It will be in 4.3 for sure, but maybe it can make it into 4.2.