ID 560038 - Using setParameter to apply an image in the Node Properties of a Shader creates a new instance of the image in the Image Manager every time

Follow

Problem summary
Using setParameter to apply an image in the Node Properties of a Shader creates a new instance of the image in the Image Manager every time
 
Customer reported version
Mari 6.0v2
 
Customer reported platform
CentOS 7
 
Steps to reproduce

  1. Create a custom Shader node that has an attribute of the type image. The attached .xml based off of the Standalone Shader Example can be used.
     
  2.  Launch Mari.
     
  3. Register the custom Shader node. The following can be used in the Python Console:
    mari.gl_render.registerCustomStandaloneShaderFromXMLFile("My Phong and Lambertian 5","path/to/Mari/Scripts/SpecularShininess5.xml")
     
  4. Add the custom Shader to the Node Graph.
     
  5. Select and view it.
     
  6. Open the Image Manager palette.
     
  7. Run the following in the Python Console, making sure to point to an image in your disk:

    geo = mari.geo.current()
    shader = geo.currentShader()
    shader.setParameter("TestMap", "path/to/yourImage.jpg")
     
  8. Run the same script again.
 
Expected behaviour
If an image on disk is already being referenced in the Image Manager, then the script shouldn't create a new instance of the same image every time it is run.
This is especially true because if this is repeatedly done manually via the Node Properties palette, the Image Manager doesn't keep creating duplicates. 
 
Actual behaviour
Every time the script is run, a new instance of the same image is created in the Image Manager.
 
Workaround
Unknown.
 
Reproduced by support
This bug has been reproduced in:
Mari 6.0v2 - Windows 10 - CentOS 7
Mari 4.8v1 - Windows 10 - CentOS 7
 
Unable to reproduce bug in:
Mari 4.7v7
 
Earliest version tested
Mari 4.7v7 - This issue doesn't appear in this version and has regressed
 
 

    We're sorry to hear that

    Please tell us why