Import objects from reference crashes scene when new security plugins loaded

Import objects from reference crashes scene when new security plugins loaded

mattanr
Explorer Explorer
1,174 Views
2 Replies
Message 1 of 3

Import objects from reference crashes scene when new security plugins loaded

mattanr
Explorer
Explorer

Hi, I've experienced crashes when I'm importing objects from references. But when I unload MayaScanner and MayaScannerCB, the imports completed without any issues.
I scanned the scene before and after importing, and also run a scan for the referenced scenes, but it always results with "no issues found".
Of course I do want to have the scan plugins on, but how can I locate the cause of this issue?

I'm using Maya 2020.2

1,175 Views
2 Replies
Replies (2)
Message 2 of 3

charliewales
Explorer
Explorer

Hi, can we get some reply about this. I find out that the culprit is inside the MayaScannerCB.py (v1.0.3), the callbacks defined there causes the crash, especifically this code before importing some references, the following line causes the crash.

 

 

# [...]
fname = OpenMaya.MFileIO.beforeReferenceFilename()
# [...]

 

 

This is inside the MayaScannerCB.py file

 

 

# [...] MayaScannerCB.py line 107
@staticmethod
def MayaScanBeforeCB(clientData):
    # This callback is only used to remember the Maya file name in case it gets cleared because
    # of reading errors so the call 'cmds.file(q=True, sn=True)' would not be able to return a
    # meaningful value
    if clientData == 'beforeOpen':
        # when running in Python 2.x, the list does not defines 'clear'
        if sys.version_info[0] < 3:
            MayaScannerCBcmd.referencedFiles[:] = []
        else:
            MayaScannerCBcmd.referencedFiles.clear()
        MayaScannerCBcmd.setFileName(clientData, OpenMaya.MFileIO.beforeOpenFilename())
    elif clientData == 'beforeImport':
        # when running in Python 2.x, the list does not defines 'clear'
        if sys.version_info[0] < 3:
            MayaScannerCBcmd.referencedFiles[:] = []
        else:
            MayaScannerCBcmd.referencedFiles.clear()
        MayaScannerCBcmd.setFileName(clientData, OpenMaya.MFileIO.beforeImportFilename())]
    elif clientData == 'beforeLoadReference' or clientData == 'beforeImportReference':
        fname = OpenMaya.MFileIO.beforeReferenceFilename()
        MayaScannerCBcmd.setFileName(clientData, fname)
        if fname not in MayaScannerCBcmd.referencedFiles:
            MayaScannerCBcmd.referencedFiles.append(fname)
# [...]

 

 

It would be good to know why this happens under certain (unknown) circumstances. Can we get any information about this? the cause, workaround, anything? In my case I'm using Maya 2019.3.1. Thanks

Message 3 of 3

gabrielF3J4E
Participant
Participant

thankfs for the tips charlie. Removing maya scanner fix the crashes here too

0 Likes