<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>447807</bug_id>
          
          <creation_ts>2022-01-02 00:51:28 +0000</creation_ts>
          <short_desc>Document.refreshProjection() does not refresh for Fill Layers</short_desc>
          <delta_ts>2022-01-04 16:58:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>krita</product>
          <component>Scripting</component>
          <version>5.0.0</version>
          <rep_platform>Microsoft Windows</rep_platform>
          <op_sys>Microsoft Windows</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>jungwnr</reporter>
          <assigned_to name="Krita Bugs">krita-bugs-null</assigned_to>
          <cc>halla</cc>
    
    <cc>thedahu.dragon</cc>
          
          <cf_commitlink>https://invent.kde.org/graphics/krita/commit/ccf08a00e75b5f9213f7919eb04660dc6f4d0cb9</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2089538</commentid>
    <comment_count>0</comment_count>
    <who name="">jungwnr</who>
    <bug_when>2022-01-02 00:51:28 +0000</bug_when>
    <thetext>SUMMARY
When using the Python Scripting to modify parameters for a Fill Layer, the fill layer does not update after calling refreshProjection().

STEPS TO REPRODUCE
1.  Create a new document.
2.  Create a new Fill Layer. Choose any color except green (because my example script will try to make it green)
3.  Run the following script:

###### SCRIPT START ######
from krita import *
import xml.etree.ElementTree as ET

activeDoc = Krita.instance().activeDocument()
node = activeDoc.nodeByName(&quot;Fill Layer 1&quot;)
config = node.filterConfig()
properties = config.properties()
xmlObj = ET.fromstring(properties[&quot;color&quot;])
xmlObj[0].set(&quot;r&quot;, &quot;0.00&quot;)
xmlObj[0].set(&quot;g&quot;, &quot;1.00&quot;)
xmlObj[0].set(&quot;b&quot;, &quot;0.00&quot;)
result = ET.tostring(xmlObj, encoding=&quot;unicode&quot;)
properties[&quot;color&quot;] = result
config.setProperty(&quot;color&quot;, properties[&quot;color&quot;])
node.setGenerator(&quot;color&quot;, config)
activeDoc.refreshProjection()
###### SCRIPT END ######

OBSERVED RESULT
The Fill Layer remains the old color. It will update correctly if you right click the layer and go to &quot;Properties&quot;.

EXPECTED RESULT
The Fill Layer color change should be reflected on the canvas.

SOFTWARE/OS VERSIONS
Windows: 10
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 5.12.12

ADDITIONAL INFORMATION
I have reproduced this issue on 2 different machines:
- Core i9 Desktop on Windows 10
- Core i7 Wacom MobileStudio Pro on Windows 10</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090025</commentid>
    <comment_count>1</comment_count>
    <who name="Halla Rempt">halla</who>
    <bug_when>2022-01-04 12:37:10 +0000</bug_when>
    <thetext>I can confirm the issue. I also see that the call to setGenerator returns True, so that is not the problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090046</commentid>
    <comment_count>2</comment_count>
    <who name="Bug Janitor Service">bug-janitor</who>
    <bug_when>2022-01-04 13:46:55 +0000</bug_when>
    <thetext>A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1277</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090082</commentid>
    <comment_count>3</comment_count>
    <who name="amyspark">amy</who>
    <bug_when>2022-01-04 16:53:10 +0000</bug_when>
    <thetext>*** Bug 447892 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090083</commentid>
    <comment_count>4</comment_count>
    <who name="amyspark">amy</who>
    <bug_when>2022-01-04 16:57:02 +0000</bug_when>
    <thetext>Git commit 60141f1b8e77ba24e927075a174aba9959a10175 by L. E. Segovia, on behalf of Halla Rempt.
Committed on 04/01/2022 at 16:44.
Pushed by lsegovia into branch &apos;master&apos;.

Update the FilLayer when the config is set from Python

When setting the filter from FillLayer,

filter()-&gt;compareTo(filterConfig.constData())

returns true, so the layer never gets updated.

M  +5    -4    libs/image/generator/kis_generator_layer.cpp
M  +2    -2    libs/image/generator/kis_generator_layer.h
M  +2    -2    libs/image/kis_adjustment_layer.cc
M  +1    -1    libs/image/kis_adjustment_layer.h
M  +2    -2    libs/image/kis_filter_mask.cpp
M  +1    -1    libs/image/kis_filter_mask.h
M  +1    -1    libs/image/kis_node_filter_interface.cpp
M  +6    -1    libs/image/kis_node_filter_interface.h
M  +2    -3    libs/libkis/FillLayer.cpp

https://invent.kde.org/graphics/krita/commit/60141f1b8e77ba24e927075a174aba9959a10175</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090084</commentid>
    <comment_count>5</comment_count>
    <who name="amyspark">amy</who>
    <bug_when>2022-01-04 16:58:09 +0000</bug_when>
    <thetext>Git commit 8eff6eed1cba30339f23c53001f750aeea49d5e4 by L. E. Segovia, on behalf of Halla Rempt.
Committed on 04/01/2022 at 16:58.
Pushed by lsegovia into branch &apos;krita/5.0&apos;.

Update the FilLayer when the config is set from Python

When setting the filter from FillLayer,

filter()-&gt;compareTo(filterConfig.constData())

returns true, so the layer never gets updated.

(cherry picked from commit 60141f1b8e77ba24e927075a174aba9959a10175)

M  +5    -4    libs/image/generator/kis_generator_layer.cpp
M  +2    -2    libs/image/generator/kis_generator_layer.h
M  +2    -2    libs/image/kis_adjustment_layer.cc
M  +1    -1    libs/image/kis_adjustment_layer.h
M  +2    -2    libs/image/kis_filter_mask.cpp
M  +1    -1    libs/image/kis_filter_mask.h
M  +1    -1    libs/image/kis_node_filter_interface.cpp
M  +6    -1    libs/image/kis_node_filter_interface.h
M  +2    -3    libs/libkis/FillLayer.cpp

https://invent.kde.org/graphics/krita/commit/8eff6eed1cba30339f23c53001f750aeea49d5e4</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2090085</commentid>
    <comment_count>6</comment_count>
    <who name="amyspark">amy</who>
    <bug_when>2022-01-04 16:58:29 +0000</bug_when>
    <thetext>Git commit ccf08a00e75b5f9213f7919eb04660dc6f4d0cb9 by L. E. Segovia, on behalf of Halla Rempt.
Committed on 04/01/2022 at 16:58.
Pushed by lsegovia into branch &apos;krita/5.0.0&apos;.

Update the FilLayer when the config is set from Python

When setting the filter from FillLayer,

filter()-&gt;compareTo(filterConfig.constData())

returns true, so the layer never gets updated.

(cherry picked from commit 60141f1b8e77ba24e927075a174aba9959a10175)

M  +5    -4    libs/image/generator/kis_generator_layer.cpp
M  +2    -2    libs/image/generator/kis_generator_layer.h
M  +2    -2    libs/image/kis_adjustment_layer.cc
M  +1    -1    libs/image/kis_adjustment_layer.h
M  +2    -2    libs/image/kis_filter_mask.cpp
M  +1    -1    libs/image/kis_filter_mask.h
M  +1    -1    libs/image/kis_node_filter_interface.cpp
M  +6    -1    libs/image/kis_node_filter_interface.h
M  +2    -3    libs/libkis/FillLayer.cpp

https://invent.kde.org/graphics/krita/commit/ccf08a00e75b5f9213f7919eb04660dc6f4d0cb9</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>