View Single Post
Old 28th September 2004, 03:25 PM   #1
Junior 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


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

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



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