Bug 403906

Summary: Tools > Scripts > Export Layers Plugin is broken by a change in a function
Product: [Applications] krita Reporter: iszotic <iszotic>
Component: ScriptingAssignee: Rebecca Breu <rebecca>
Status: RESOLVED FIXED    
Severity: minor CC: rebecca, tamtamy.tymona
Priority: NOR    
Version First Reported In: 4.1.7   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Stack trace of the Export Layers plugin (content of the error message it shows)

Description iszotic 2019-02-04 00:13:47 UTC
From krita lime ppa
2:4.1.0-0~201902011749~ubuntu18.04.1
2:4.1.7-1~bionic 
SUMMARY

There was a change (apparently) in the Node.save() function that breaks the "Export Layers" built-in plugin.
Line 172 of it has:
node.save(layerFileName, self.xResSpinBox.value(), self.yResSpinBox.value())

but if you check the documentation the Node.save() function has a fourth argument "const InfoObject &  exportConfiguration" so as expected the plugin throws a "Not enough arguments" error

STEPS TO REPRODUCE
1. Open krita file
2. Tools > Scripts > Export Layers
3. Error Window

OBSERVED RESULT

The plugin throws a "not enough arguments" error

EXPECTED RESULT

save the layers

Krita
  Version: 4.2.0-pre-alpha

Qt
  Version (compiled): 5.9.5
  Version (loaded): 5.9.5

OS Information
  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 4.15.0-29-generic
  Pretty Productname: Ubuntu 18.04.1 LTS
  Product Type: ubuntu
  Product Version: 18.04


OpenGL Info 
  Vendor:  ATI Technologies Inc. 
  Renderer:  "AMD Radeon (TM) RX 480 Graphics" 
  Version:  "3.0.13536 Compatibility Profile Context 18.30.2.15" 
  Shading language:  4.50 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, profile  QSurfaceFormat::OpenGLContextProfile(CompatibilityProfile)) 
  Current format:    QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::SwapBehavior(DoubleBuffer), swapInterval 0, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile)) 
     Version: 3.0
     Supports deprecated functions true 
     is OpenGL ES: false 

Hardware Information
 Memory: 31 Gb
 Cores: 16
 Swap: /tmp
Comment 1 Tiar 2019-02-04 00:35:14 UTC
Created attachment 117815 [details]
Stack trace of the Export Layers plugin (content of the error message it shows)

I can confirm it happens. The Export Layers plugin was working in Krita 4.1.7.
Comment 2 Rebecca Breu 2019-02-07 19:23:42 UTC
Git commit d556b73a186dae91d963a78a49993d1d8fbf4a24 by Rebecca Breu.
Committed on 07/02/2019 at 19:21.
Pushed by rbreu into branch 'master'.

Adjust Export Layers plugin to new Node.save call
Differential Revision: https://phabricator.kde.org/D18736

M  +2    -1    plugins/python/exportlayers/uiexportlayers.py

https://commits.kde.org/krita/d556b73a186dae91d963a78a49993d1d8fbf4a24