THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2008 at 13:20, xxxxxxxx wrote:
Basically, you have one 'main.cpp' and a bunch of individual plugin sources in the plugins:cineme4dsdk folder. The thing with Cinema 4D plugins is that there are many different types of plugin (command, object, tag, material, scenehook, etc.). So the first thing that you need to determine is what kind of plugin yours should be.
For example, lets say that you just want a command plugin - something that does something to the current document. The source for those is under the source:gui folder. The main.cpp is required for every C++ plugin and you'll need the source for the type in question and the res files as well.
Your new project should be in its own folder with the copied sources:
..cinema4dsdk.vcproj -> myplugin.vcproj
....menutest.cpp -> myplugin.cpp
Rename the project and menutest.cpp. Rename the interior classes and change the Register method. In main.cpp, you'll only need the new Register method for your plugin. For now, you can use any of the .tif files but don't forget to make your own eventually. dialogs contains the resource file for the dialog which describes the layout and gui elements. You can either do it this way or add layout elements programmatically for your dialog class that extends GeDialog.
Open the new project in Visual Studio or Xcode and make the appropriate source code reference changes and removals.
For a command dialog, you need a plugin class derived from CommandData and, optionally, a dialog derived from GeDialog for options/results/preview/whatever. Main registers the plugin class derived from CommandData and that plugin opens the dialog when a user selects the command from the Plugins menu.
You'll want to add your IDs for dialog elements and plugins (plugins require unique IDs acquired here) to the c4d_symbols.h file (removing the cinema4dsdk stuff). Add text for the dialog elements (by ID) to a c4d_strings.str file in strings_us. Again, you could add strings programmatically when doing the dialog layout - but then you won't be able to support multiple languages.
For the most part, once you have a working base like this, you can use this as a template for future projects - instead of modifying the cinema4dsdk every time.