Interactive/OpenForComparison.py

##
## (C) Copyright 2008 Autodesk, Inc.  All rights reserved.
##
## Use of this software is subject to the terms of the Autodesk license
## agreement provided at the time of installation or download, or which
## otherwise accompanies this software in either electronic or hard copy
## form.
##

# If you change the location of three files (or add more), dragging this onto
# Showcase icon/empty session will load all the files for comparison, go
# full screen and side-by-side display.


from ScriptRunner import ScriptRunner
from Modes        import ApplicationModeName, ScreenMode, LayoutId


class OpenForComparison( ScriptRunner ):
    def __init__( self, scriptName, args ):
        ScriptRunner.__init__( self, scriptName, args )

        # The last entry is the default for the left side of the compare,
        # the first entry is the default for the right side of the compare.
        self.filesToCompare = (
            "C:/FullPathToOne/one.a3s",
            "C:/FullPathToTwo/two.a3s",
            "C:/FullPathToThree/three.a3s",
            )


    def Main( self ):
        # First one is loaded using open, the following ones with
        # stage open.
        message = "APPLICATION_LOAD_SCENE"
        for entry in self.filesToCompare:
            self.sendMessageSync( message, (entry,), userTimeout=-1 )
            message = "STAGE_OPEN"

        # As an example:

        # Display in the full screen:
        self.sendMessage( 'SCREEN_SET_MODE',
                          (ScreenMode.kFullScreen,) )

        # Turn off the heads up display mode:
        self.sendMessageSync( 'HEADS_UP_DISPLAY_SET_MODE',
                              (False,) )

        # Go into view mode:
        self.sendMessageSync( 'APPLICATION_SET_MODE',
                              (ApplicationModeName.kViewing,), )

        # Go into side-by-side:
        self.sendMessageSync( 'VIEWER_SET_LAYOUT',
                              (2, LayoutId.kSideBySide,) )


# ===============================================================
def instantiate( scriptName, args ):
    return OpenForComparison( scriptName, args )
# ===============================================================