PDA

View Full Version : Cinema4d plugin + c#?


ReyOne
08-02-2011, 05:04 PM
hi,
i want to programm a plguin for cinema 4d in c#. I heard that i shall use the SWIG converter cause it converts c++ into c#. So i can convert the cinema 4d cdk from c++ into c#
Also i heard i need mono-develop but as far as i can see its just a editor. Am I right?
I've visual studio and i prefer to use that for programming.
So my question is does anyone already use those tool in combination to create a cinema 4d plugin?
I actually stucked currently at the installation lol.
anyone can help install the tools the right way?

anyways thanks!

cnadams
08-03-2011, 03:00 AM
G'Day Ray,

SWIG doesn't convert the c++ to c#, it simply wraps up the c++ and exposes it as an interface to higher level scripts/languages.

If you are used to visual studio then I'd stick with that because it's a better tool than any of the Mono alternatives.

Cam

ThE_JacO
08-08-2011, 04:25 AM
hi,
i want to programm a plguin for cinema 4d in c#. I heard that i shall use the SWIG converter cause it converts c++ into c#. So i can convert the cinema 4d cdk from c++ into c#
You heard wrong I'm afraid.
SWIG doesn't convert anything, SWIG takes a set of headers and other infos, and helps automating the build of a set of bindings between the libraries/code interfaces sourced from those headers, and a higher level language that it might support.

It's not as straightforward as feeding it a bunch of things randomly and getting flawless bindings out of it, and it will require some C++ experience to get anything barely usable out, not to mention the bindings will only be as good as the headers and the user side work, and in the best of cases (due to the nature of the conversion) clunky as hell.

Also i heard i need mono-develop but as far as i can see its just a editor. Am I right?
You heard wrong again I'm afraid :)
Mono is a cross-platform effort to enable .NET on platforms other than windows.
Mono-develop is an IDE facilitating mono specific development.
Unless you plan to work cross platform, you don't need either.

I've visual studio and i prefer to use that for programming.
for C# it's arguably the best thing you can use.

So my question is does anyone already use those tool in combination to create a cinema 4d plugin?
Not a C4D expert, but I doubt anybody did, and if you developed solid bindings for the C++ API to interface with something else, you would probably be better off selling those in first place :)

I actually stucked currently at the installation lol.
anyone can help install the tools the right way?
If you got stuck at the installation of something, then laughed it off out loud, and you start off by not understanding what SWIG does or what Mono is, chances are you'd be biting more than you can chew.
I'd suggest to pick up C++ if you intend to develop for any 3D Application out there.

If you're really adamant in wanting to write in C# though, and this is maybe some school project that requires you to, then AD|Softimage (used to be Softimage|XSI) is the only major app out there, that I know of at least, that natively supports C# between the API supported languages.

anyways thanks!
You're welcome.
Good luck :)

Per-Anders
08-08-2011, 06:20 AM
As others have already mentioned C# without a binding of some sort is out of the question (though that could always be your plugin if you fancy attempting ot make all the SWIG headers).

Normal development for C4D offers four paths. COFFEE which is somewhat similar to JScript, XPresso (node based expressions which can be password locked for distribution), Python, and C++.

If you chose to use C++ then projects have been set up for Visual Studio 2005 and XCode 3, you can update these in VS2008/2010 and I suppose if you wanted XCode 4 although not supported yet (and may cause problems which you will have to resolve yourself).

The C++ library is fairly extensive, should you want to bind it for use with another language then you're looking at quite a lot of legwork, it's not impossible though, the Python implementation started life this way as the private project of just one plugin developer.

If you're just starting out then I recommend beginning with either COFFEE or Python, both are easy and offer immediate gratification, the C++ API doesn't differ dramatically either so transitioning tools is fairly easy and it offers a nice rapid development environment to test out ideas.

If you ahve more questions then feel free to ask them either in the scripting subforum in the C4D/Bodypaint area here on CGTalk or over at Plugincafe.com

CGTalk Moderation
08-08-2011, 06:20 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.