/* CMD: ½ConfigVT3D                                                     */
/* By Brett Evan Hester      13032 Copenhill Rd. Dallas, Tx. 75240-5302 */
	MacrosName = "ConfigVT3D"
/* Macro Type:                                                          */
/* SPECIAL     * WARNING!  * REMEMBERS                                  */
/* Description:                                                         */
/* -------------------------------------------------------------------- */
/*      This macro allows for easier and perminent changes to certain   */
/*      LightWave default settings. ":Toaster/3D/LW-Config" is the file */
/*      loaded, edited, and saved. The Toaster only reads this file     */
/*      when first entering LightWave's layout area. The Toaster also   */
/*      saves this file when leaving LightWave's layout area. Since     */
/*      the file is only read when first entering LightWave, and this   */
/*      macro edits the file while inside LightWave; the file must be   */
/*      protected from being overwritten with the standard settings     */
/*      when leaving LightWave. To protect the file from being          */
/*      overwritten the AmigaDOS PROTECT command is used. Since the     */
/*      file will be protected, LightWave will notify the user of an    */
/*      error when leaving LightWave. A unprotect patch is also a part  */
/*      of this macro; for the next time the user enters the modeler    */
/*      after completely leaving LightWave.                             */
/* -------------------------------------------------------------------- */

Info1A = "!ConfigVT3D ©                  Information 1 of 2"
Info1B = ""
Info1C = "@This macro sets LightWave's default settings.   "
Info1D = "@There are four pages of settings. This page     "
Info1E = "@allows for user definable requester buttons.    "
Info1F = ""
Info1G = "þ BUTTONs 1 to 4 relate to those next to parent "
Info1H = "¤ button on all file requesters.                "
Info1I = ""
Info1J = "þ NAME string is the title which appears on the "
Info1K = "¤ specified button.                             "
Info1L = ""
Info1M = "þ PATH string is the actual device and path for "
Info1N = "¤ the specified button.                         "

Info2A = "!ConfigVT3D ©                  Information 1 of 2"
Info2B = ""
Info2C = "@This macro sets LightWave's default settings.   "
Info2D = "@There are four pages of settings. This page     "
Info2E = "@allows for user definable default file pathes.  "
Info2F = ""
Info2G = "þ Note: not only the standard (device and path) "
Info2H = "¤     format supported but that of just the name"
Info2I = "¤     of specified drawer within the 3D drawer. "
Info2J = "þ Example- SCENES path could be:                "
Info2K = "¤                                               "
Info2L = "¤          SYS:Toaster/3D/Scenes/               "
Info2M = "¤                                               "
Info2N = "¤          Scenes                               "

Info3A = "!ConfigVT3D ©                  Information 1 of 2"
Info3B = ""
Info3C = "@This macro sets LightWave's default settings.   "
Info3D = "@There are four pages of settings. This page sets"
Info3E = "@the --LightWave Layout Record Menu-- defaults.  "
Info3F = ""
Info3G = "þ All settings correlate to those of of the     "
Info3H = "¤ `Record Menu' in LightWave's Layout Area.     "
Info3I = ""
Info3J = "þ If no default setting is wanted for:          "
Info3K = "¤    RECORD SETUP 1                             "
Info3L = "¤    RECORD SETUP 2                             "
Info3M = "¤    RECORD COMMAND                             "
Info3N = "þ Type `(NONE)' in the desired field or fields. "

Info4A = "!ConfigVT3D ©                  Information 1 of 2"
Info4B = ""
Info4C = "@This macro sets LightWave's default settings.   "
Info4D = "@There are four pages of settings. This page sets"
Info4E = "@some defaults that cannot be set anywhere else. "
Info4F = ""
Info4G = "þ STATUS FILE is a file saved while rendering.  "
Info4H = "¤ This is for those who know or use ARexx.      "
Info4I = ""
Info4J = "þ DEFAULT TENSION relates to motion path tension"
Info4K = "þ DEFAULT ZOOM relates to a camera's zoom factor"
Info4L = "þ FRAME END BEEP for when rendering is finished "
Info4M = "þ EXPERT MODE stops the showing of requesters   "
Info4N = "¤ like: `This option may increase render time'  "

Info5A = "!ConfigVT3D ©                  Information 2 of 2"
Info5B = "@               Plug-Ins and Go! ©               "
Info5C = "                           Hester and associates"
Info5D = "                           13032 Copenhill Road "
Info5E = "                           Dallas, Texas 75240  "
Info5F = "@Special Thanks to:                              "
Info5G = "Arnie Cachelin  Henry Ribron    Mark J. Holland "
Info5H = "J. Phil Kelso   Terry Wester    Steven K. Simms "
Info5I = "Kevin DeRita    Greg Glaser     William S. Hawes"
Info5J = "NewTek ©        Commodore ©     INOVAtronics ©  "
Info5K = ""
Info5L = "@This macro represents a lot of time & hard work."
Info5M = "@Encourage people to create new ones and not kill"
Info5N = "@that possibility by stealing those that are out."

/* -------------------------------------------------------------------- */
                                     /* Start Error Detection (See End) */
SIGNAL ON ERROR
SIGNAL ON SYNTAX
                                                   /* Address LightWave */
VT3DLib = ADDLIB("LWModelerARexx.port",0)
ADDRESS "LWModelerARexx.port"
                                               /* Add Support Functions */
SupportLib = "rexxsupport.library"
IF POS(SupportLib , SHOW('L')) = 0 THEN
	IF ~ADDLIB(SupportLib , 0 , -30 , 0) THEN DO
		CALL Notify(1,"!Can't find "SupportLib)
		IF (VT3DLib) THEN CALL REMLIB("LWModelerARexx.port")
		EXIT
	END

/* -------------------------------------------------------------------- */
                                                       /* Startup Patch */
IF (EXISTS(":Toaster/3D/LW-Config")) THEN DO
	PARSE VALUE STATEF(":Toaster/3D/LW-Config") WITH TempA TempB TempC ProtectionBits .
	IF ProtectionBits = "----R---" THEN DO
		ReqA = "!ConfigVT3D ©                                                    NOTE / PATCH"
		ReqB = ""
		ReqC = "@- - - - - - - The LightWave Configuration File is protected. - - - - - - - -"
		ReqD = ""
		ReqE = "  If you already used this macro,        If you already used this macro,    "
		ReqF = "  to change the default settings,        to change the default settings,    "
		ReqG = "  and completely exited LightWave at     and have not completely exited     "
		ReqH = "  least once.                            LightWave, please do so and return."
		ReqI = ""
		ReqJ = "@Select OK to turn off the protection | Select CANCEL to leave the protection"
		ReqK = "@on the configuration file.           | on the configuration file.           "
		ReqL = "@  ·                                  |                                 ·    "
		IF Notify(2, ReqA, ReqB, ReqC, ReqD, ReqE, ReqF, ReqG, ReqH, ReqI, ReqJ, ReqK, ReqL) = 1 THEN DO
			ADDRESS COMMAND 'PROTECT ":Toaster/3D/LW-Config" rwed'
			CALL Notify(1,"!Unprotecting...","@:Toaster/3D/LW-Config","!DONE!")
		END
		CALL Exiting
	END
END

/* -------------------------------------------------------------------- */
                                                        /* Startup Note */
ReqA = "!ConfigVT3D ©                                      NOTE / PATCH"
ReqB = ""
ReqC = "@þ Note: When exiting LightWave, the current configuration file"
ReqD = "@  is normally saved.  In order for this macro to work it must "
ReqE = "@  write-protect the configuration file created by this macro. "
ReqF = "@  A requester will appear when exiting LightWave, saying:     "
ReqG = "!""Can't open configuration file"""
ReqH = "@þ To remove this requester:                                   "
ReqI = "@  Exit and Return to LightWave, Select ConfigVT3D again       "
ReqJ = ""
ReqK = "þ  This may sound akward but it works.-                        "
ReqL = ""
OKorCANCEL = Notify(2, ReqA, ReqB, ReqC, ReqD, ReqE, ReqF, ReqG, ReqH, ReqI, ReqJ, ReqK, ReqL)
IF OKorCancel = 0 THEN CALL Exiting

/* -------------------------------------------------------------------- */
                                          /* Perminent Default Settings */
DfltName1 = "DH0" ; DfltPath1 = "DH0:"
DfltName2 = "DH1" ; DfltPath2 = "DH1:"
DfltName3 = "DF0" ; DfltPath3 = "DF0:"
DfltName4 = "RAM" ; DfltPath4 = "RAM:"
DfltScn = "Scenes"
DfltObj = "Objects"
DfltSrf = "Surfaces"
DfltImg = "Images"
DfltFrm = "Images"
DfltMtn = "Motions"
DfltEnv = "Envelopes"
DfltPre = "Previews"
DfltStatusFile = "(none)"
DfltDfltTension = "0.000000"
DfltDfltZoom = "3.200000"
DfltFrmEndBeep  = "0"
DfltRecS1 = "(none)"
DfltRecS2 = "(none)"
DfltRecCmd = "(none)"
DfltRecDel = "0.000000"
DfltFrmDel = "0.000000"
DfltExpertMode = "0"

/* -------------------------------------------------------------------- */
                                              /* Recalling Macro config */
BEHName1 = "DH0" ; BEHPath1 = "DH0:"
BEHName2 = "DH1" ; BEHPath2 = "DH1:"
BEHName3 = "DF0" ; BEHPath3 = "DF0:"
BEHName4 = "RAM" ; BEHPath4 = "RAM:"
BEHScn = "Scenes"
BEHObj = "Objects"
BEHSrf = "Surfaces"
BEHImg = "Images"
BEHFrm = "Images"
BEHMtn = "Motions"
BEHEnv = "Envelopes"
BEHPre = "Previews"
BEHStatusFile = "(none)"
BEHDfltTension = "0.000000"
BEHDfltZoom = "3.200000"
BEHFrmEndBeep  = "0"
BEHRecS1 = "(none)"
BEHRecS2 = "(none)"
BEHRecCmd = "(none)"
BEHRecDel = "0.000000"
BEHFrmDel = "0.000000"
BEHExpertMode = "0"

IF (EXISTS(":Toaster/3D/LW-Config")) THEN DO
	IF (~OPEN(BEHConfigFile, ":Toaster/3D/LW-Config", 'R')) THEN BREAK
	IF (READLN(BEHConfigFile) ~= "LWCO") THEN BREAK

	X = READLN(BEHConfigFile)

	PARSE VALUE READLN(BEHConfigFile) with X BEHName1 BEHPath1
	BEHName1 = STRIP(BEHName1)
	BEHPath1 = STRIP(BEHPath1)
	PARSE VALUE READLN(BEHConfigFile) with X BEHName2 BEHPath2
	BEHName2 = STRIP(BEHName2)
	BEHPath2 = STRIP(BEHPath2)
	PARSE VALUE READLN(BEHConfigFile) with X BEHName3 BEHPath3
	BEHName3 = STRIP(BEHName3)
	BEHPath3 = STRIP(BEHPath3)
	PARSE VALUE READLN(BEHConfigFile) with X BEHName4 BEHPath4
	BEHName4 = STRIP(BEHName4)
	BEHPath4 = STRIP(BEHPath4)

	PARSE VALUE READLN(BEHConfigFile) with X BEHScn
	BEHScn = STRIP(BEHScn)
	PARSE VALUE READLN(BEHConfigFile) with X BEHObj
	BEHObj = STRIP(BEHObj)
	PARSE VALUE READLN(BEHConfigFile) with X BEHSrf
	BEHSrf = STRIP(BEHSrf)
	PARSE VALUE READLN(BEHConfigFile) with X BEHImg
	BEHImg = STRIP(BEHImg)
	PARSE VALUE READLN(BEHConfigFile) with X BEHFrm
	BEHFrm = STRIP(BEHFrm)
	PARSE VALUE READLN(BEHConfigFile) with X BEHMtn
	BEHMtn = STRIP(BEHMtn)
	PARSE VALUE READLN(BEHConfigFile) with X BEHEnv
	BEHEnv = STRIP(BEHEnv)
	PARSE VALUE READLN(BEHConfigFile) with X BEHPre
	BEHPre = STRIP(BEHPre)

	PARSE VALUE READLN(BEHConfigFile) with X BEHStatusFile
	BEHStatusFile = STRIP(BEHStatusFile)
	PARSE VALUE READLN(BEHConfigFile) with X BEHDfltTension
	BEHDfltTension = STRIP(BEHDfltTension)
	PARSE VALUE READLN(BEHConfigFile) with X BEHDfltZoom
	BEHDfltZoom = STRIP(BEHDfltZoom)
	PARSE VALUE READLN(BEHConfigFile) with X BEHFrmEndBeep
	BEHFrmEndBeep = STRIP(BEHFrmEndBeep)
	PARSE VALUE READLN(BEHConfigFile) with X BEHRecS1
	BEHRecS1 = STRIP(BEHRecS1)
	PARSE VALUE READLN(BEHConfigFile) with X BEHRecS2
	BEHRecS2 = STRIP(BEHRecS2)
	PARSE VALUE READLN(BEHConfigFile) with X BEHRecCmd
	BEHRecCmd = STRIP(BEHRecCmd)
	PARSE VALUE READLN(BEHConfigFile) with X BEHRecDel
	BEHRecDel = STRIP(BEHRecDel)
	PARSE VALUE READLN(BEHConfigFile) with X BEHFrmDel
	BEHFrmDel = STRIP(BEHFrmDel)
	PARSE VALUE READLN(BEHConfigFile) with X BEHExpertMode
	BEHExpertMode = STRIP(BEHExpertMode)

	CALL CLOSE(BEHConfigFile)
END

/* -------------------------------------------------------------------- */
                                              /* For Information Window */
BEHInfo = 1
                      /* For Coming Back to Main Menu after Info Window */
DO WHILE BEHInfo > 0

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

	CALL Req_Begin("File Requester Buttons          1 of 4")

	CALL Req_AddControl("",'T', "ConfigVT3D ©    By Brett Hester     ")
	CALL Req_AddControl("",'T', "")
	CALL Req_AddControl("",'T', "Button Number 1 ")
	ReqName1 = Req_AddControl("Name",'S', '30')
	ReqPath1 = Req_AddControl("Path",'S', '30')
	CALL Req_AddControl("",'T', "Button Number 2")
	ReqName2 = Req_AddControl("Name",'S', '30')
	ReqPath2 = Req_AddControl("Path",'S', '30')
	CALL Req_AddControl("",'T', "Button Number 3")
	ReqName3 = Req_AddControl("Name",'S', '30')
	ReqPath3 = Req_AddControl("Path",'S', '30')
	CALL Req_AddControl("",'T', "Button Number 4")
	ReqName4 = Req_AddControl("Name",'S', '30')
	ReqPath4 = Req_AddControl("Path",'S', '30')
	BEHInfo = Req_AddControl("",'CH', 'File Req. Default Information')

	CALL Req_SetVal(ReqName1, BEHName1)
	CALL Req_SetVal(ReqPath1, BEHPath1)
	CALL Req_SetVal(ReqName2, BEHName2)
	CALL Req_SetVal(ReqPath2, BEHPath2)
	CALL Req_SetVal(ReqName3, BEHName3)
	CALL Req_SetVal(ReqPath3, BEHPath3)
	CALL Req_SetVal(ReqName4, BEHName4)
	CALL Req_SetVal(ReqPath4, BEHPath4)
	CALL Req_SetVal(BEHInfo, 0)

	IF Req_Post() = 0 THEN CALL Exiting

	BEHName1 = Req_GetVal(ReqName1)
	BEHPath1 = Req_GetVal(ReqPath1)
	BEHName2 = Req_GetVal(ReqName2)
	BEHPath2 = Req_GetVal(ReqPath2)
	BEHName3 = Req_GetVal(ReqName3)
	BEHPath3 = Req_GetVal(ReqPath3)
	BEHName4 = Req_GetVal(ReqName4)
	BEHPath4 = Req_GetVal(ReqPath4)
	BEHInfo = Req_GetVal(BEHInfo)

	CALL Req_End()

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                         /* Using File Requester Format */
	IF BEHInfo = 1 THEN DO
		BEHPath1 = GetFileName("-- #1 "||BEHName1||" --", BEHPath1)
		BEHPath2 = GetFileName("-- #1 "||BEHName2||" --", BEHPath2)
		BEHPath3 = GetFileName("-- #1 "||BEHName3||" --", BEHPath3)
		BEHPath4 = GetFileName("-- #1 "||BEHName4||" --", BEHPath4)
	END

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                 /* Recalling standard default settings */
	IF BEHInfo = 2 THEN DO
		BEHName1 = DfltName1
		BEHPath1 = DfltPath1
		BEHName2 = DfltName2
		BEHPath2 = DfltPath2
		BEHName3 = DfltName3
		BEHPath3 = DfltPath3
		BEHName4 = DfltName4
		BEHPath4 = DfltPath4
	END

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

	InfoOnScreen = 1
	IF BEHInfo = 3 THEN CALL InformationWindows

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                                        /* Verify Input */
	Error = 0 ; ReqB = "" ; ReqC = "" ; ReqD = "" ; ReqE = ""

	IF LENGTH(BEHName1) > 7 THEN DO
		Error = 1 ; ReqB = '@Button Number 1 - "'||BEHName1||'" is too long.'
	END
	IF LENGTH(BEHName2) > 7 THEN DO
		Error = 1 ; ReqC = '@Button Number 2 - "'||BEHName2||'" is too long.'
	END
	IF LENGTH(BEHName3) > 7 THEN DO
		Error = 1 ; ReqD = '@Button Number 3 - "'||BEHName3||'" is too long.'
	END
	IF LENGTH(BEHName4) > 7 THEN DO
		Error = 1 ; ReqE = '@Button Number 4 - "'||BEHName4||'" is too long.'
	END

	IF Error ~= 0 THEN DO
		ReqA = "!Sorry!,"
		ReqF = "No more than seven characters is allowed for a button name."
		CALL Notify(1, ReqA, ReqB, ReqC, ReqD, ReqE, ReqF)
		BEHInfo = 4
	END

	IF BEHPath1 = "(none)" THEN DO
		BEHPath1 = GetFileName("#1 "||BEHName1||" -- PATH WAS NOT DEFINED!", DfltPath1)
		BEHInfo = 4
	END
	IF BEHPath2 = "(none)" THEN DO
		BEHPath2 = GetFileName("#2 "||BEHName2||" -- PATH WAS NOT DEFINED!", DfltPath2)
		BEHInfo = 4
	END
	IF BEHPath3 = "(none)" THEN DO
		BEHPath3 = GetFileName("#3 "||BEHName3||" -- PATH WAS NOT DEFINED!", DfltPath3)
		BEHInfo = 4
	END
	IF BEHPath4 = "(none)" THEN DO
		BEHPath4 = GetFileName("#4 "||BEHName4||" -- PATH WAS NOT DEFINED!", DfltPath4)
		BEHInfo = 4
	END

END

/* -------------------------------------------------------------------- */
                                              /* For Information Window */
BEHInfo = 1
                      /* For Coming Back to Main Menu after Info Window */
DO WHILE BEHInfo > 0

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

	CALL Req_Begin("LightWave File Pathes           2 of 4")

	CALL Req_AddControl("",'T', "ConfigVT3D ©    By Brett Hester     ")
	CALL Req_AddControl("",'T', "")
	ReqScn = Req_AddControl("Scenes",'S','30')
	ReqObj = Req_AddControl("Objects",'S','30')
	ReqSrf = Req_AddControl("Surfaces",'S','30')
	ReqImg = Req_AddControl("Images",'S','30')
	ReqFrm = Req_AddControl("Framestores",'S','30')
	ReqMtn = Req_AddControl("Motions",'S','30')
	ReqEnv = Req_AddControl("Envelopes",'S','30')
	ReqPre = Req_AddControl("Previews",'S','30')
	BEHInfo = Req_AddControl("",'CH', 'File Req. Default Information')

	CALL Req_SetVal(ReqScn, BEHScn )
	CALL Req_SetVal(ReqObj, BEHObj )
	CALL Req_SetVal(ReqSrf, BEHSrf )
	CALL Req_SetVal(ReqImg, BEHImg )
	CALL Req_SetVal(ReqFrm, BEHFrm )
	CALL Req_SetVal(ReqMtn, BEHMtn )
	CALL Req_SetVal(ReqEnv, BEHEnv )
	CALL Req_SetVal(ReqPre, BEHPre )
	CALL Req_SetVal(BEHInfo, 0)

	IF Req_Post() = 0 THEN CALL Exiting

	BEHScn = Req_GetVal(ReqScn)
	BEHObj = Req_GetVal(ReqObj)
	BEHSrf = Req_GetVal(ReqSrf)
	BEHImg = Req_GetVal(ReqImg)
	BEHFrm = Req_GetVal(ReqFrm)
	BEHMtn = Req_GetVal(ReqMtn)
	BEHEnv = Req_GetVal(ReqEnv)
	BEHPre = Req_GetVal(ReqPre)
	BEHInfo = Req_GetVal(BEHInfo)

	CALL Req_End()

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                         /* Using File Requester Format */
	IF BEHInfo = 1 THEN DO
		BEHScn = GetFileName("-- Scenes --", BEHScn)
		BEHObj = GetFileName("-- Objects --", BEHObj)
		BEHSrf = GetFileName("-- Surfaces --", BEHSrf)
		BEHImg = GetFileName("-- Images --", BEHImg)
		BEHFrm = GetFileName("-- Framestores --", BEHFrm)
		BEHMtn = GetFileName("-- Motions --", BEHMtn)
		BEHEnv = GetFileName("-- Envelopes --", BEHEnv)
		BEHPre = GetFileName("-- Previews --", BEHPre)
	END

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                 /* Recalling standard default settings */
	IF BEHInfo = 2 THEN DO
		BEHScn = DfltScn
		BEHObj = DfltObj
		BEHSrf = DfltSrf
		BEHImg = DfltImg
		BEHFrm = DfltFrm
		BEHMtn = DfltMtn
		BEHEnv = DfltEnv
		BEHPre = DfltPre
	END

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
	InfoOnScreen = 2
	IF BEHInfo = 3 THEN CALL InformationWindows
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                                        /* Verify Input */
	IF BEHScn = "(none)" THEN DO
		BEHScn = GetFileName("Scenes -- PATH WAS NOT DEFINED!", DfltScn)
		BEHInfo = 4
	END
	IF BEHObj = "(none)" THEN DO
		BEHObj = GetFileName("Objects -- PATH WAS NOT DEFINED!", DfltObj)
		BEHInfo = 4
	END
	IF BEHSrf = "(none)" THEN DO
		BEHSrf = GetFileName("Surfaces -- PATH WAS NOT DEFINED!", DfltSrf)
		BEHInfo = 4
	END
	IF BEHImg = "(none)" THEN DO
		BEHImg = GetFileName("Images -- PATH WAS NOT DEFINED!", DfltImg)
		BEHInfo = 4
	END
	IF BEHFrm = "(none)" THEN DO
		BEHFrm = GetFileName("Framestores -- PATH WAS NOT DEFINED!", DfltFrm)
		BEHInfo = 4
	END
	IF BEHMtn = "(none)" THEN DO
		BEHMtn = GetFileName("Motions -- PATH WAS NOT DEFINED!", DfltMtn)
		BEHInfo = 4
	END
	IF BEHEnv = "(none)" THEN DO
		BEHEnv = GetFileName("Envelopes -- PATH WAS NOT DEFINED!", DfltEnv)
		BEHInfo = 4
	END
	IF BEHPre = "(none)" THEN DO
		BEHPre = GetFileName("Previews -- PATH WAS NOT DEFINED!", DfltPre)
		BEHInfo = 4
	END

END

/* -------------------------------------------------------------------- */
                                              /* For Information Window */
BEHInfo = 1
                      /* For Coming Back to Main Menu after Info Window */
DO WHILE BEHInfo > 0

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

	CALL Req_Begin("Record Settings                 3 of 4")

	CALL Req_AddControl("",'T', "ConfigVT3D ©    By Brett Hester     ")
	CALL Req_AddControl("",'T', "")
	ReqRecS1 = Req_AddControl("Record Setup 1",'S','30')
	ReqRecS2 = Req_AddControl("Record Setup 2",'S','30')
	ReqRecCmd = Req_AddControl("Record Command",'S',''30)
	ReqRecDel = Req_AddControl("Record Delay",'S','30')
	ReqFrmDel = Req_AddControl("First Frame Delay",'S','30')
	BEHInfo = Req_AddControl("",'CH', 'Default Information')

	CALL Req_SetVal(ReqRecS1, BEHRecS1 )
	CALL Req_SetVal(ReqRecS2, BEHRecS2 )
	CALL Req_SetVal(ReqRecCmd, BEHRecCmd )
	CALL Req_SetVal(ReqRecDel, BEHRecDel )
	CALL Req_SetVal(ReqFrmDel, BEHFrmDel )
	CALL Req_SetVal(BEHInfo, 0)

	IF Req_Post() = 0 THEN CALL Exiting

	BEHRecS1 = Req_GetVal(ReqRecS1)
	BEHRecS2 = Req_GetVal(ReqRecS2)
	BEHRecCmd = Req_GetVal(ReqRecCmd)
	BEHRecDel = Req_GetVal(ReqRecDel)
	BEHFrmDel = Req_GetVal(ReqFrmDel)
	BEHInfo = Req_GetVal(BEHInfo)

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                 /* Recalling standard default settings */
	IF BEHInfo = 1 THEN DO
		BEHRecS1 = DfltRecS1
		BEHRecS2 = DfltRecS2
		BEHRecCmd = DfltRecCmd
		BEHRecDel = DfltRecDel
		BEHFrmDel = DfltFrmDel
	END

	CALL Req_End()

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

	InfoOnScreen = 3
	IF BEHInfo = 2 THEN CALL InformationWindows

END

/* -------------------------------------------------------------------- */
                                              /* For Information Window */
BEHInfo = 1
                      /* For Coming Back to Main Menu after Info Window */
DO WHILE BEHInfo > 0

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

	CALL Req_Begin("Miscellaneous                   4 of 4")

	CALL Req_AddControl("",'T', "ConfigVT3D ©    By Brett Hester     ")
	CALL Req_AddControl("",'T', "")
	ReqStatusFile = Req_AddControl("Status File",'S','30')
	ReqDfltTension = Req_AddControl("Default Tension",'S','30')
	ReqDfltZoom = Req_AddControl("Default Zoom Factor",'S','30')
	ReqFrmEndBeep = Req_AddControl("Frame End Beep",'B')
	ReqExpertMode = Req_AddControl("Expert Mode",'B')
	BEHInfo = Req_AddControl("",'CH','Default Information')

	CALL Req_SetVal(ReqStatusFile, BEHStatusFile)
	CALL Req_SetVal(ReqDfltTension, BEHDfltTension)
	CALL Req_SetVal(ReqDfltZoom, BEHDfltZoom)
	CALL Req_SetVal(ReqFrmEndBeep, BEHFrmEndBeep)
	CALL Req_SetVal(ReqExpertMode, BEHExpertMode)
	CALL Req_SetVal(BEHInfo, 0)

	IF Req_Post() = 0 THEN CALL Exiting

	BEHStatusFile = Req_GetVal(ReqStatusFile)
	BEHDfltTension = Req_GetVal(ReqDfltTension)
	BEHDfltZoom = Req_GetVal(ReqDfltZoom)
	BEHFrmEndBeep = Req_GetVal(ReqFrmEndBeep)
	BEHExpertMode = Req_GetVal(ReqExpertMode)
	BEHInfo = Req_GetVal(BEHInfo)

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */
                                 /* Recalling standard default settings */
	IF BEHInfo = 1 THEN DO
		BEHStatusFile = DfltStatusFile
		BEHDfltTension = DfltDfltTension
		BEHDfltZoom = DfltDfltZoom
		BEHFrmEndBeep = DfltFrmEndBeep
		BEHExpertMode = DfltExpertMode
	END

	CALL Req_End()

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  */

	InfoOnScreen = 4
	IF BEHInfo = 2 THEN CALL InformationWindows

END

/* -------------------------------------------------------------------- */
                                                /* Unprotecting Config. */
IF (EXISTS(":Toaster/3D/LW-Config")) THEN DO
	ADDRESS COMMAND 'PROTECT ":Toaster/3D/LW-Config" rwed'
END

/* -------------------------------------------------------------------- */
                                              /* Recording Macro Config */

IF (OPEN(BEHConfigFile, ":Toaster/3D/LW-Config", 'W')) THEN DO
	CALL WRITELN(BEHConfigFile, "LWCO")
	CALL WRITELN(BEHConfigFile, "0")

	CALL WRITELN(BEHConfigFile, "FileReqPreset1" BEHName1 BEHPath1)
	CALL WRITELN(BEHConfigFile, "FileReqPreset2" BEHName2 BEHPath2)
	CALL WRITELN(BEHConfigFile, "FileReqPreset3" BEHName3 BEHPath3)
	CALL WRITELN(BEHConfigFile, "FileReqPreset4" BEHName4 BEHPath4)

	CALL WRITELN(BEHConfigFile, "ScenesDirectory" BEHScn)
	CALL WRITELN(BEHConfigFile, "ObjectsDirectory" BEHObj)
	CALL WRITELN(BEHConfigFile, "SurfacesDirectory" BEHSrf)
	CALL WRITELN(BEHConfigFile, "ImagesDirectory" BEHImg)
	CALL WRITELN(BEHConfigFile, "FramestoresDirectory" BEHFrm)
	CALL WRITELN(BEHConfigFile, "MotionsDirectory" BEHMtn)
	CALL WRITELN(BEHConfigFile, "EnvelopesDirectory" BEHEnv)
	CALL WRITELN(BEHConfigFile, "PreviewsDirectory" BEHPre)

	CALL WRITELN(BEHConfigFile, "StatusFilename" BEHStatusFile)
	CALL WRITELN(BEHConfigFile, "DefaultTension" BEHDfltTension)
	CALL WRITELN(BEHConfigFile, "DefaultZoomFactor" BEHDfltZoom)
	CALL WRITELN(BEHConfigFile, "FrameEndBeep" BEHFrmEndBeep)
	CALL WRITELN(BEHConfigFile, "RecordSetup1" BEHRecS1)
	CALL WRITELN(BEHConfigFile, "RecordSetup2" BEHRecS2)
	CALL WRITELN(BEHConfigFile, "RecordCommand" BEHRecCmd)
	CALL WRITELN(BEHConfigFile, "RecordDelay" BEHRecDel)
	CALL WRITELN(BEHConfigFile, "FirstFrameDelay" BEHFrmDel)
	CALL WRITELN(BEHConfigFile, "ExpertMode" BEHExpertMode)

	CALL CLOSE BEHConfigFile
END

/* -------------------------------------------------------------------- */
                                                  /* Protecting Config. */
ADDRESS COMMAND 'PROTECT ":Toaster/3D/LW-Config" r'

ReqA = "!Saving...  Protecting..."
ReqB = "@:Toaster/3D/LW-Config"
ReqC = "!DONE!"
ReqD = ""
ReqE = "@After completely leaving LightWave,"
ReqF = "@please return to this macro.       "

CALL Notify(1,ReqA,ReqB,ReqC,ReqD,ReqE,ReqF)

CALL Exiting

/* -------------------------------------------------------------------- */
                                                              /* Ending */
Exiting:

	IF (VT3DLib) THEN CALL REMLIB("LWModelerARexx.port")
	EXIT

RETURN

/* -------------------------------------------------------------------- */
                                                 /* Information Windows */
InformationWindows:

	IF InfoOnScreen = 1 THEN OKorCancel = Notify(2, Info1A, Info1B, Info1C, Info1D, Info1E, Info1F, Info1G, Info1H, Info1I, Info1J, Info1K, Info1L, Info1M, Info1N)
	IF InfoOnScreen = 2 THEN OKorCancel = Notify(2, Info2A, Info2B, Info2C, Info2D, Info2E, Info2F, Info2G, Info2H, Info2I, Info2J, Info2K, Info2L, Info2M, Info2N)
	IF InfoOnScreen = 3 THEN OKorCancel = Notify(2, Info3A, Info3B, Info3C, Info3D, Info3E, Info3F, Info3G, Info3H, Info3I, Info3J, Info3K, Info3L, Info3M, Info3N)
	IF InfoOnScreen = 4 THEN OKorCancel = Notify(2, Info4A, Info4B, Info4C, Info4D, Info4E, Info4F, Info4G, Info4H, Info4I, Info4J, Info4K, Info4L, Info4M, Info4N)
	IF OKorCancel = 1 THEN CALL Notify(1, Info5A, Info5B, Info5C, Info5D, Info5E, Info5F, Info5G, Info5H, Info5I, Info5J, Info5K, Info5L, Info5M, Info5N)

RETURN

/* -------------------------------------------------------------------- */
                                                      /* Error Handling */
SYNTAX:
ERROR:

	ErrCode = RC
	ErrLine = SIGL
	ErrInfo = ERRORTEXT(ErrCode)

	Err1 = "!Sorry!"
	Err2 = "An Error has been detected"
	Err3 = "@þ Macro -            "
	Err4 = "@þ Line Number -      "
	Err5 = "@þ Error Code -       "
	Err6 = "@þ Error Description -"
	Err7 = "@¤ Please Inform -    "
	Err8 = '  "Error Notice"     '
	Err9 = "  13032 Copenhill Rd."
	Err10 = "  Dallas, TX. 75240  "

	Call Notify(1,Err1,Err2,Err3,MacrosName,Err4,ErrLine,Err5,ErrCode,Err6,ErrInfo,Err7,Err8,Err9,Err10)

/* -------------------------------------------------------------------- */
                                             /* Advanced Error Handling */
	CALL SETCLIP("ErrorMacro",MacrosName)
	CALL SETCLIP("ErrorLine",ErrLine)
	CALL SETCLIP("ErrorCode",ErrCode)
	CALL SETCLIP("ErrorDesc",ErrInfo)

	PARSE SOURCE TempA TempB ErrFile TempC TempD TempE

	CALL SETCLIP("ErrorFile",ErrFile)

/* -------------------------------------------------------------------- */

	IF (VT3DLib) THEN CALL REMLIB("LWModelerARexx.port")
	EXIT
