# OJ_SaveScenePlugin
# Initial code generated by Softimage SDK Wizard
# Executed Fri Jan 11 13:50:40 EST 2013 by mc
# 
# Tip: To add a command to this plug-in, right-click in the 
# script editor and choose Tools > Add Command.
import win32com.client
from win32com.client import constants

null = None
false = 0
true = 1

def XSILoadPlugin( in_reg ):
	in_reg.Author = "mc"
	in_reg.Name = "OJ_SaveScenePlugin"
	in_reg.Major = 1
	in_reg.Minor = 0

	in_reg.RegisterCommand("OJ_SaveScene","OJ_SaveScene")
	in_reg.RegisterMenu(constants.siMenuMainFileSceneID,"OJ_SaveScene_Menu",false,false)
	#RegistrationInsertionPoint - do not remove this line

	return true

def XSIUnloadPlugin( in_reg ):
	strPluginName = in_reg.Name
	Application.LogMessage(str(strPluginName) + str(" has been unloaded."),constants.siVerbose)
	return true

def OJ_SaveScene_Init( in_ctxt ):
	oCmd = in_ctxt.Source
	oCmd.Description = ""
	oCmd.ReturnValue = true

	return true

def OJ_SaveScene_Execute(  ):

    Application.LogMessage("OJ_SaveScene_Execute called",constants.siVerbose)
    Application.SetValue("PlayControl.Current", 0, "")
    Application.SetCurrentPass("Passes.Default_Pass")	
    Application.SaveScene()

    return true

def OJ_SaveScene_Menu_Init( in_ctxt ):
	oMenu = in_ctxt.Source
	oMenu.AddCommandItem("OJ_SaveScene","OJ_SaveScene")
	return true

