Possible maya/shotgun bug?

Hey all I just found something and wanted to inquire here to see if it’s a bug. I have a problem when opening a maya file that has a dependence on a plugin that is not installed on the current machine. An example of this would be say someone opens and works on a file and has mtoa loaded. Then someone else opens that file and mtoa is not installed on that persons machine. Normally maya throws and error saying plugin not found. However if you do this through the shotgun file open system a huge popup comes up saying “can’t open the scene” (see screen shot below). The scene opens up but shotgun itself is not in the current correct context. So it seems like and error of file loading inside of maya causes shotgun to completely dump out of its initial scene setup and context loading. This seems like this could be a HUGE problem say if we have a remote artist working on something and they have unique plugins loaded (which happens all the time) then these files will break coming back over to us. Is there anyway to wrap this type of error in a try except so that the scene setup would continue on and not completely dump out?

1 Like

Looking into this a bit more it seems as though the plugin trying to load is not the issue here but rather the attributes that the plugin adds in scene that are associated with it. However, this will still present the same problem if any other plugins do something similar I still feel like shotgun should not stop its process based on file errors like this. If the scene is able to be loaded shotgun should be able to set its context.

Arnold is really annoying plugin that pollutes scenes with lots of attributes.

In the scene_operation hook I catch any exceptions from the cmds.file command and display them as a maya warning instead.

1 Like

That sounds like exactly what I am looking to do. Would you mind sharing a bit of your code on how you are accomplishing that? I have the location here as I have some scene_operation overrides I am doing but a working example would be a lot of help. Thanks!

        elif operation == "open":
            # do new scene as Maya doesn't like opening
            # the scene it currently has open!
            cmds.file(new=True, force=True)
            try:
                # this is here for the stupid plugin errors
                cmds.file(file_path, open=True, force=True)
            except Exception as e:
                cmds.warning(e)
3 Likes