View Single Post
Old 11th December 2003, 07:34 AM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Export plugin configure dialog

Unfortunately, this symbol was not exported as C, but C++. I'll fix this for the next release.

You should be able to refine it with:

Prototype void prefs_append_prefspec(PrefSpec *n);

in your C++ plugin.



add a pref like this:

Code:
static double grid_size = 1.0;

PrefSpec pref = 
{
    "field_grid_size", PREF_DOUBLE, (void *)&grid_size,
};


AC3D_PLUGIN_FUNC int AC3DPluginInit()
{
double ver = ac_get_version_number();

	prefs_append_prefspec(&pref);

...
This means that it will be saved and loaded from the AC3D settings file.
It won't appear in the settings dialog. If you want to access the pref from within tcl, you need to call.

Code:
Prototype void ac_tcl_link_pref(PrefSpec *p);
The var can now be accessed in tcl with pref_field_grid_size.

You can set a function to be called before the filename selection of you importer:

Prototype Boolean ac_exporter_set_settings_function(char *suffix, ac_file_settings_func func); // to be called before export

If 'func' returns TRUE, the exporter function will be called.
You'll need to make a tcl dialog which uses a tcl 'vwait' to block the eventhandler before returning.

Another way to do this would be:

ac_add_command( ogre_plugin", ogre_function );
ac_add_export_menu_item("Ogre...", "ac3d ogre_plugin");

Then in the ogre_function, you can popup a tcl dialog and do your own saving from there.

A good reference for tcl/tk is AC3D's own tcl/tk files in the tcl directory. Other than that - a google search should find some docs.

Andy
Andy is offline   Reply With Quote