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

Reply
 
Thread Tools Display Modes
Old 15th June 2006, 09:59 PM   #1
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Question Using other plugins within a plugin

Hey. Can you call a plugin within a plugin?
For example, can I call the VRML2 plugin within my own plugin?

Thanks
conzar is offline   Reply With Quote
Old 15th June 2006, 11:29 PM   #2
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Using other plugins within a plugin

You *may* be able to using the tcl_command()

Such as:

tcl_command( "ac3d <command_name>" );

You can get many command names from looking at the TCL scripts in the AC3D tcl folder. However, I don't know any of the import commands.

Also, not sure if there are any "gotchas" with doing this. The only one I can think of is that it may generate its own Undo step?

Last edited by Dennis; 15th June 2006 at 11:32 PM.
Dennis is offline   Reply With Quote
Old 19th June 2006, 09:16 PM   #3
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Using other plugins within a plugin

Yea, the problem is I don't know what the name of the exporter function is.
There are several functions relating to vrml but non that expose the functions for exporting

How would one get at those?
conzar is offline   Reply With Quote
Old 20th June 2006, 01:23 AM   #4
Andy
Administrator
Professional user
 
Andy's Avatar
 
Join Date: Jun 2003
Posts: 4,563
Default Re: Using other plugins within a plugin

You can do this (tcl):

Code:
ac3d exporter_write_file <exportername> "mynewfile.wrl"


Where <exportername> is "VRML1", "VRML2" or "VRML2PROTO"


You can find all the available exporter names with:


Code:
 
set ids [ac3d exporters_get_names]
puts $ids



Last edited by Andy; 20th June 2006 at 01:26 AM.
Andy is offline   Reply With Quote
Old 20th June 2006, 06:34 PM   #5
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Using other plugins within a plugin

Well, I think that gets me closer but still not all the way there yet.

So what I am looking to do is slice up a scene by group. So what I would like to do is pass the vrml exporter an ACObject. Can you pass up a pointer from C++ to tcl?

Or is there a way to call an exporter with a C++ call?

Seems like if u knew the function name for vrml exporter here u could call it. Is that right?
Code:
Boolean (*ac_file_exporter_func)(char *filename, ACObject *object);
conzar is offline   Reply With Quote
Old 20th June 2006, 10:56 PM   #6
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Using other plugins within a plugin

So I have thought up of exporting through c++ by using the tcl function call.

Code:
char *tcl_command(char *fmt, ...);
So what I have done is chopped up my objects (by removing the objects that I don't want to export, and then calling the tcl_command).

Not exactly sure what the parameters for the tcl_command should be though

so far Ive tried this
Code:
tcl_command("ac3d","exporter_write_file","\"VRML2\"",\"file.wrl\");
that doesn't seem to work. Do I need to copy everything into one string?
conzar is offline   Reply With Quote
Old 21st June 2006, 12:32 AM   #7
Dennis
Senior Member
Professional user
 
Dennis's Avatar
 
Join Date: Jul 2003
Posts: 899
Default Re: Using other plugins within a plugin

Quote:
Originally Posted by conzar
so far Ive tried this
Code:
tcl_command("ac3d","exporter_write_file","\"VRML2\"",\"file.wrl\");
that doesn't seem to work. Do I need to copy everything into one string?
Yes, everything wants to be copied into one string, so your above command should be something like:

Code:
tcl_command("ac3d exporter_write_file VRML2 file.wrl");
Mind that I haven't tested this, but that's the format in which tcl_command() should take your statement. Not sure about the args, whether quotes are needed, etc.

Additional (fmt,...) args can be used to create your TCL command string as if it were in a printf() statement.
Dennis is offline   Reply With Quote
Old 21st June 2006, 06:39 AM   #8
conzar
Member
Advanced member
 
conzar's Avatar
 
Join Date: May 2006
Posts: 36
Default Re: Using other plugins within a plugin

Thanks Dennis & Andy!!!!!
Your right about not needing the
Code:
"
in the arguments of the tcl_command.

So my preliminary tests work. I'll finish up my exporter tonight when I get home from work.

Thanks guys!
conzar is offline   Reply With Quote
Reply

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 07:39 PM.


AC3D Forum
(C) Inivis Limited 2020