PDA

View Full Version : how to popup a dialog box in modifier plugin


ejann99
04-03-2008, 12:27 AM
I am coding a modifier plug-in in maxscript . I have added a button to this modifier . Now I want to implement a function. It is that as long as I click the button ,it would pop up a dialog box to select a file.
The small function likes that pointcache modifier which can load the source file.

ejann99
04-03-2008, 12:42 AM
sorry , the same question posted before.
can administrator delete this one.
I am coding a modifier plug-in in maxscript . I have added a button to this modifier . Now I want to implement a function. It is that as long as I click the button ,it would pop up a dialog box to select a file.
The small function likes that pointcache modifier which can load the source file.

Bobo
04-03-2008, 01:24 AM
I am coding a modifier plug-in in maxscript . I have added a button to this modifier . Now I want to implement a function. It is that as long as I click the button ,it would pop up a dialog box to select a file.
The small function likes that pointcache modifier which can load the source file.

So you want to press the button and get a file dialog pop up to select a file for loading or saving, right?
*Implement an 'on yourButton pressed do()' event handler
*In the handler, call getSaveFileName() or getOpenFileName() depending on whether you want to pick an existing file for loading, or a new file to save to. See the Help for details on how to specify types etc.
*Assign the return value of the function to a variable.
*Check to see whether the content of the variable is undefined or not, if it isn't, then a valid file name was returned and you can display it and possibly store it in a string parameter in a paramBlock in the scripted plugin.

If you asked about something different, please explain.

ejann99
04-03-2008, 02:15 AM
Sorry, everyone . I think I don't explain my question well. Anyway , thanks for everyone's response. Finally I solve my problem. The key is that normal button cannot be supported in plugin modifier , only checkbutton can be supported. So I use checkbutton to open the dialogbox to load my file.

CGTalk Moderation
04-03-2008, 02:15 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.