15th June 2006, 09:59 PM | #1 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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 |
15th June 2006, 11:29 PM | #2 |
Senior Member
Professional user
Join Date: Jul 2003
Posts: 899
|
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. |
19th June 2006, 09:16 PM | #3 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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? |
20th June 2006, 01:23 AM | #4 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,565
|
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. |
20th June 2006, 06:34 PM | #5 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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); |
20th June 2006, 10:56 PM | #6 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
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, ...); 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\"); |
21st June 2006, 12:32 AM | #7 | |
Senior Member
Professional user
Join Date: Jul 2003
Posts: 899
|
Re: Using other plugins within a plugin
Quote:
Code:
tcl_command("ac3d exporter_write_file VRML2 file.wrl"); Additional (fmt,...) args can be used to create your TCL command string as if it were in a printf() statement. |
|
21st June 2006, 06:39 AM | #8 |
Member
Advanced member
Join Date: May 2006
Posts: 36
|
Re: Using other plugins within a plugin
Thanks Dennis & Andy!!!!!
Your right about not needing the Code:
" So my preliminary tests work. I'll finish up my exporter tonight when I get home from work. Thanks guys! |
|
|