Bug 482490

Summary: Cross-channel color adjustment filter could not be configured by script
Product: [Applications] krita Reporter: mbcnve
Component: ScriptingAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.2.2   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Bug Depends on:    
Bug Blocks: 482491    
Attachments: Test code
Source code about 'nTransfer'
driver channel

Description mbcnve 2024-03-05 20:32:53 UTC
Cross-channel color adjustment filter could not be configured by script. When such a filter is created by code, its configuration property is initialized to {'nTransfers': 0}. However, a normal color adjustment filter created by GUI dialog has configuration properties like  {'curve0': '0,0.5;1,0.5;', 'curve1': '0,0.5;1,0.5;', 'curve2': '0,0.5;1,0.5;', 'curve3': '0,0.5;1,0.5;', 'curve4': '0,0;1,0.5;', 'curve5': '0,0.5;1,0.5;', 'curve6': '0,0.5;1,0.5;', 'curve7': '0,0.5;1,0.5;', 'nTransfers': 8}. Then, I tried to add these cruve information to the initial empty configuration created by script. However, the code didn't work as expected, that the cruve 0-7 is added to filter configuration while property 'nTransfers' always remains 0. (fig.1)

According to the source code (fig.2), property 'nTransfers' should change with the curve infomation added, but it didn't work. Furthermore,the curve infomation is also ignored, the filter created by the script didn't work as the curve info I specified.

Moreover, the curve 0-7 only specify the mapping curve for 8 output channels. However, the driver channel is not specified by the filter configuration, which means that dirver channel infomation could not be accessed by script.(fig.3)

Similar problem with other colour adjustment filter: https://krita-artists.org/t/scripting-with-colour-adjustment-filter-layer/23229
Comment 1 mbcnve 2024-03-05 20:33:54 UTC
Created attachment 166437 [details]
Test code
Comment 2 mbcnve 2024-03-05 20:35:42 UTC
Created attachment 166438 [details]
Source code about 'nTransfer'
Comment 3 mbcnve 2024-03-05 20:37:53 UTC
Created attachment 166439 [details]
driver channel
Comment 4 mbcnve 2024-03-05 20:52:54 UTC

*** This bug has been marked as a duplicate of bug 482491 ***