Go Back   AC3D Forums > Technical > AC3D Developers
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 28th September 2004, 03:25 PM   #1
fractile
Junior Member
Member
 
Join Date: Sep 2004
Location: Tampere, Finland
Posts: 14
Default plugin gui problem (and question on selections)

I have started making a planar/cubic texture mapper plugin. It's my first ac3d plugin. and I can't get my gui working..

I have tcl script for the gui that works fine when executed manually in console. I does not work in ac3d. I finally tested with an empty script and that causes SEG_FAULT as well.

This is the simplest script I could imagine:

-- ac3d_texturemapper.tcl --
proc tm_map_planar_gui {} {
}

This is how I try to use it (mostly copy-paste from examples):

-- ac3d_texturemapper.c --
AC3D_PLUGIN_FUNC int AC3DPluginInit(AC3DPluginInitData *d)

{
char *path = (char *)strdup(d->plugin_dir_path);
#ifdef WINDOWS

ac_unbackslash_string(path);

#endif
tcl_command("source \"%s/ac3d_texturemapper.tcl\"", path);
free(path)


ac_add_surface_menu_item("Map texture..", "ac3d tm_map_planar_gui", "Texture mapper plugin (planar)");

return(0);

}

Wheneven I choose the menu item, AC3D crashes. What am I missing here?

This can't be a compiler problem, since the plugin works fine without the tcl part (menu item pointing directly to a c -function).

I have also a question on selections: I read a previous post on hidden status and selections. Based on that I tried using ac_selection_get_whole_surfaces_all() to access selected surfaces. If I have understood correctly this list is read-only, right? How am I supposed to skip unselected surfaces when processing object tree/surfaces recursively?

- Mikko
fractile is offline   Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT -4. The time now is 05:03 PM.


AC3D Forum
(C) Inivis Limited 2020