State:Closed|icon_bug|database:public|icon_mari|Resolution:Fixed|TargetRelease:4.7v3|BugID:460239|
Problem summary
mari.images.add() does not copy given image object when used in a function.
Customer reported version
mari.n/a
Customer reported platform
Steps to reproduce
1) From Mari, open the Python console.
2) Run the following snippet:
def convertColor(): img = mari.images.list()[0] cfg = mari.ocio.currentColorspaceConfig().fileName() newImg = mari.ocio.transformImage(cfg, 'sRGB', 'linear', img) mari.images.add(newImg, 'new')convertColor() 3) View the Image Manager for any additional items.
Expected behavior
The Image Manager should display the additional image from running the Python snippet.
Actual behavior
The image is not copied into the Image Manager.
Workaround
Running the same code outside of a function seems to work correctly:
img = mari.images.list()[0]cfg = mari.ocio.currentColorspaceConfig().fileName()newImg = mari.ocio.transformImage(cfg, 'g22_rec709', 'lin_ap1', img)mari.images.add(newImg, 'new')
Reproduced by Support in:
Mari 4.6v4 - Windows 10
Mari 4.6v1 - Windows 10
Mari 4.5v1 - Windows 10
Mari 4.0v1 - Windows 10
Mari 3.0v1 - Windows 10
Mari 2.6v5 - Windows 10
Earliest version tested
Mari 2.6v5 - This issue appears to be in all versions of the product
We're sorry to hear that
Please tell us why