c++ or COFFEE
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/02/2008 at 13:41, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10
Platform: Windows ;
Language(s) : C.O.F.F.E.E ; C++ ;---------Should I start by using Coffee and the Script Editor, or should I just use C++ with the SDK. I thought I knew C++ until I started reading the SDK.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/02/2008 at 15:57, xxxxxxxx wrote:
Depends on what you want to do. Serious plugin development = C++, day to day scripting or small to mid size plugins can still be achieved with COFFEE (though with restrictions). COFFEE is never a bad choice, but could be the wrong (or right) choice depending on what you want to do.
In the beginning it´s always hard, kind of confusing. But it gets better.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 07/02/2008 at 16:33, xxxxxxxx wrote:
Knowing the language (C++) and knowing the interface (SDK) are two different things. Goes for any development beyond the standard libraries included with a language. You want to develop Windows applications, you need to learn the Windows SDK. Ergo, you will need to learn the Cinema 4D SDK similarly.
It is a bit terse at first, but there are tons of examples here and some people who can answer most questions (Matthias, Katachi, CactusDan, me, et al).
If you decide to start with COFFEE then it is highly recommended to get Rui Batista's COFFEE book.
Best of luck.
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2008 at 05:32, xxxxxxxx wrote:
Thanks for the advice. Robert, you were telling someone to widdle down the example in the plugins source folder. I was looking at this code, but there is a lot of code there so I wouldn't know where to start widdling. Is there a smaller example out here that you know of off hand that would be an easier starting point? Thanks again,
Mike -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 08/02/2008 at 05:41, xxxxxxxx wrote:
What kind of example are you looking for?
I think you really can't say COFFEE or C++ is more difficult than the other. It really depends on what you are doing. COFFEE is really nice to write scripts and it hasn't to be re-compiled every time like C++. But C++ on the other hand is faster and the C++ API goes much deeper than COFFEE.
cheers,
Matthias -
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:
MyPlugin
..cinema4dsdk.vcproj -> myplugin.vcproj
..source
....main.cpp
....menutest.cpp -> myplugin.cpp
..res
....c4d_symbols.h
....pluginicon.tif
....dialogs
......myplugin.res
....strings_us
......c4d_strings.usRename 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.