|
|
CINEMA 4D, Revision 6
COFFEE
plugin tutorial
(a link will be available to part 8 of this tutorial soon) coffee
tutorial 1: Introduction
For QuickStarters: * copy and paste the listing text (below) to a simple text editor and save it as a plain text file under the name 'lesson3.cof' into the C4D "plugins" folder. * restart c4d (or use the menu command "Reload Plugins") * Open the window "Console" * execute the plugin-menu command "coffee-lesson-3" * the console shows the word "Hello"
The Explanation:
Main is executed once when the Plugins are being loaded. This happens when C4D is started and also with the "Reload Plugins"-command in the "console"-window. We register our object (here: oMenuPlugin) in this main.
MenuPlugin is a class (of C4D), a collection of functions. Our class (oMenuPlugin) will be constructed from this class. All functions that should work after our rules overwrite the standard functions. Additional functions (which do not apply here) will attend our class. MenuPlugin owns more functions, but these 5 are the bottom limit. If c4d misses just one of them while loading, it is claimed by c4d it in the console-window.
signs our class. Don't bother, that's the way it has to be.
Equally a function which can be taken over everytime and unchanged in order to hand the plugin ID number over. Every PlugIn needs a unique number before being distributed.
This is a menu-plugin. The text declared here ('coffee-lesson-3' in this case) forms the name of the C4D plugin menu entry. If the xxx.cof-file resides as the only file in a sub-folder of the Plugin-folder, it will appear directly in the menu. If there are more than one xxx.cof's, a submenu with the name of the sub-folder will be created automatically.
This text will be shown in the C4D status-bar when the mouse-cursor is moved over the menu-entry.
Let's get it working ;-) When the menu-command is executed, this extremely useful function writes a "Hello" (or whatever you have programmed) into the console-window. ---------------------------------------- |
|
|
Vantage
Graphics and Design Limited Page last updated: 05 July 2001 |