PDA

View Full Version : button load max scene (max6 sp1)


DeadlyFreeze
06-04-2004, 07:00 PM
Im really flying by the seat of my pants, I've never done any type of scripting before so I'm really lost.

What I'm trying to do is use the VMS editor to make a menu with a button, when you hit the button it load a specified max scene.

which looks something like this:

rollout unnamedRollout "Open Scene" width:162 height:300
(
button btn2 "Button" pos:[10,15] width:106 height:29
on btn2 pressed do
do getOpenFileName $max/scenes/blueprint.max
)

and I get an error from my listner

>> MAXScript FileIn Exception: -- Syntax error: at ), expected while
-- In line: ) <<

I really have no clue, and the few referance files that came with max arnt much help. Any help would be appricated, hopefully someone will read this... this part of the forum seems alittle dead. :???:

blesson2k
19-04-2004, 10:28 AM
You have an extra do in the getOpenFileName line. and moreover getOpenFileName only displays the open dialog box. Your code should look like this:


rollout unnamedRollout "Open Scene" width:162 height:300
(
button btn2 "Button" pos:[10,15] width:106 height:29

on btn2 pressed do
loadmaxFile "$max/scenes/blueprint.max"
)
createDialog (unnamedRollout)

cheers
Blesson