My PlugIns don't work
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/04/2005 at 03:10, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 9.1 Demo
Platform: Windows ;
Language(s) : C.O.F.F.E.E ;---------
Hello....Maybe I'm a little bit stupid...*g*.
My examples don't work.
Perhaps, I didn't understand, how C.O.F.F.E.E. works. The language isn't so difficult for me because I've learned programming languages like C++, Java and C#.
I don't really understand, how to implement those plugins. When I open C4D, how do I write plugins? Must I create an object, so that I can open a C.O.F.F.E.E.-Script Window by clicking on File->Cinema 4D Tags->C.O.F.F.E.E.??? How else can I write plugins, f.ex. MenuPlugins??? Is there a tutorial where I can find some answers? Or can anyone describe what I have to do?Furthermore I get some errors when using examples from the C.O.F.F.E.E.-reference, f.ex.:
// be sure to use a unique ID obtained from www.plugincafe.com var PLUGIN_ID = 1000001; // be sure to use a unique ID obtained from www.plugincafe.com // make a dialog class class MyDialog : GeModalDialog { public: MyDialog(); CreateLayout(); } MyDialog::MyDialog() { super(); } MyDialog::CreateLayout() { SetTitle("Hello World"); AddStaticText(4000,BFH_FIT,0,0,"Hello World",BORDER_THIN_IN); AddDlgGroup(DR_DLGGROUP_OK|DR_DLGGROUP_CANCEL); return TRUE; } // register plugin in menu class MyMenuPlugin : MenuPlugin { public: MyMenuPlugin(); GetID(); GetName(); GetHelp(); Execute(doc); } MyMenuPlugin::MyMenuPlugin() { super(); } MyMenuPlugin::GetID() { return PLUGIN_ID; } MyMenuPlugin::GetName() { return "Hello World"; } MyMenuPlugin::GetHelp() { return "Demonstrates a simple modal dialog"; } MyMenuPlugin::Execute(doc) { var d = new(MyDialog); d->Open(-1,-1); } main() { Register(MyMenuPlugin); }
When I compile, everything is ok.
When I execute, this message appears:Too many parameters
Line: -1???
Can you help me????
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 06/04/2005 at 11:32, xxxxxxxx wrote:
COFFEE plugins are just plain text files. You can compile using "COFFEE compiler" menu plugin, but I wouldn't until you've checked the veracity of the plugin. Compiled COFFEE code does not give accurate error feedback.
You write the plugin file with a .cof extension (.coh for any headers). The files must reside in Cinema 4D's Plugins folder. MenuPlugins are registered to the Plugins menu and executed by selecting the corresponding menu item. If you compile the code, you cannot have both the compiled code and uncompiled code residing in the Plugins folder (they have the same PLUGIN_ID, now don't they!).
The COFFEE documentation (which you can download) has tons of examples.