import maya.api.OpenMaya as om
from V2A.Video2ARKitNode import Video2ARKitNode 
from V2A.Video2ARKitCommand import Video2ARKitCommand

def maya_useNewAPI():
    pass

def initializePlugin(mobject):
    mplugin = om.MFnPlugin(mobject, "YourName", "1.0", "Any")
    try:
        mplugin.registerNode(Video2ARKitNode.NODE_NAME, Video2ARKitNode.NODE_ID, 
                             Video2ARKitNode.creator, Video2ARKitNode.initialize)
        
    except:
        om.MGlobal.displayError("Failed to register node")

    try:
        mplugin.registerCommand(Video2ARKitCommand.COMMAND_NAME, 
                                Video2ARKitCommand.creator,
                                Video2ARKitCommand.createSyntax)
    except:
        om.MGlobal.displayError("Failed to register command")

def uninitializePlugin(mobject):
    mplugin = om.MFnPlugin(mobject)
    try:
        mplugin.deregisterNode(Video2ARKitNode.NODE_ID)
    except:
        om.MGlobal.displayError("Failed to deregister node")

    try:
        mplugin.deregisterCommand(Video2ARKitCommand.COMMAND_NAME)
    except:
        om.MGlobal.displayError("Failed to deregister command") 