ID 337468 - KeyErrors are encountered when importing a customer session script

Follow

Problem summary
When importing the attached session script, an exception is thrown due to channel.resize being called without using the correct mari.ImageSet type

Customer reported version
3.3v1
Customer reported platform
centos7

Steps to reproduce

1) Launch Mari

2) Download the attached archive and session

3) Open the archive

4) Import the attached .msf using the below script:

uvIndex = 210
dstUvIndex = 192
msfPath = '/path/to/sessionscript.msf'

mariDstGeo = mari.geo.find('dva_eyes')
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()

5) The following KeyError is returned:

Traceback (most recent call last):
File "<string>", line 10, in <module>
File "C:/Program Files/Mari4.0v2/Bundle/Media/Scripts\Mari\session\types\geo_entity.py", line 326, in copyChannels
channel.remapPatchUvIndexes(uvIndexesMap)
File "C:/Program Files/Mari4.0v2/Bundle/Media/Scripts\Mari\session\types\channel.py", line 394, in remapPatchUvIndexes
mappedPatches[targetIndex] = self.patches[key]
KeyError: 210


6) If this issue is resolved, then the below error is returned. Note that this step has not been reproduced by Support.

exceptions.TypeError, 'mari.Channel.resize' called with wrong argument types:
mari.Channel.resize(int, list)
Supported signatures:
mari.Channel.resize(mari.Mari::ImageSet.Size, list = QList< int >())


Workaround
Unknown. 

Reproduced by support
Mari 4.0v2 - Windows 7, CentOS7
Mari 4.0v1
Mari 3.3v1- Windows 7, CentOS7
Mari 3.2v1
Mari 3.1v3
Mari 3.1v1
Mari 3.0v4
Mari 3.0v1 - Windows 7, CentOS7

Earliest version tested
Mari 3.0v1 - Session Scripts Implemented

Expected behaviour

No errors should be encountered

Actual behaviour
The session script code required modification to avoid encountering these errors when the session is imported

    We're sorry to hear that

    Please tell us why