ID 336912 - In some sessions the texture data may be exported in an incorrect colorspace

Follow

Problem summary
In some sessions, when using the copyChannels function via the API, the texture data may be exported in an incorrect colorspace

Customer reported version
4.0v2
Customer reported platform
centos7

Steps to reproduce

1) Open the attached archive

2) In the Python Console palette, replace 'object1' and 'object2' in the below script with the name of the objects in the project and run:

import os

filename = 'DVA_4.0'
uvIndex = 210
dstUvIndex = 192

geo = mari.geo.find('object1')

patch = geo.patch(uvIndex)
exportDir = 'path/to/export/dir/'
if not os.path.exists(exportDir):
os.mkdir(exportDir)
mari.session.exportSession(exportDir, geoEntities=[geo],
geoPatches=[patch], projectors=[])

msfPath = os.path.join(exportDir, filename, filename+'.msf')

mariDstGeo = mari.geo.find('object2')
uvIndexMap = {uvIndex : [dstUvIndex]} ## in 3.1 keys must be strings
dstGeo = mari.session.types.GeoEntity.fromMariObject(mariDstGeo, None)
srcProj = mari.session.types.Project.fromMSF(msfPath)
srcGeo = srcProj.geoEntities[0]
copiedChannels = dstGeo.copyChannels(srcGeo.channels, uvIndexMap)
dstGeo.make()

3) Note that the colorspace in the copy appears to be darker than expected. Even the object with no textures will appear as though the base colour grey is in an incorrect colorspace.

Workaround
Working around this issue is unfortunately a very manual process but can be done by using the 'OCIO Colorspace' filter from the filters menu and applying a colorspace transform to each of the affected layers after the session has been imported.

Reproduced by support
Mari 4.0v2 - Windows 7, CentOS7
Mari 4.0v1 - Windows 7, CentOS7

Earliest version tested
Mari 3.3v1 - Colorspace issue does not occur but script requires altering
Mari 3.1v3 - Script works as expected and no issues occur

Expected behaviour
The exported textures should be kept within the same colorspace as they originate unless specified otherwise by the script
Actual behaviour
The colorspace was incorrect in the final export meaning that textures looked darker after copying

    We're sorry to hear that

    Please tell us why