Identify when scene is finished loading in Maya

Solution 1:

I'm not really familiar with the Maya C++ API but there is a mal/python solution that may suit your needs. I know this question is tagged C++ so I'll remove it if this is not an acceptable answer.

There is a scriptJob command in the maya.cmds mel/python library that allows to bind the execution of a code when an event or condition happens in Maya.

def printStuff():
    # We are printing stuff here, but this can be a call to your C++ plugin
    # Example:
    # import cppPlugin
    # cppPlugin.doActionOnSceneLoaded()
    print "Scene has been loaded"

cmds.scriptJob(e=('SceneOpened', printStuff))

Once this code is executed, every time your open a scene, once it's fully loaded this will print a line. Instead of printing a line you can do a call to your C++ Plugin. My C++ skills a rusty by now, it's been a while I havn't practised but you can bind C++ methods to a Python call, you can get some infos here and here.

You can write this script in userSetup.pyto load it when Maya is launched. You can get more informations on userSetup files here