C# plugin with C++ core

Hello

I know there is already a sample here GitHub - dalefugier/Moose: Demonstrates how to share a common library with both a C++ and a C# plug-in. showing combining C++ with C#.

I would like to keep the C++ portion as simple as possible - is there a way to avoid all the MFC stuff? I simply want the ability to pass in Rhino objects in (e.g. mesh objects) for processing, there is no GUI or plugin related elements (commands etc) at all.

Thanks

Rhino Render and Raytraced have Cycles as its core, written in C++. There is no MFC. You just need to have a C API into your C++.

You can check GitHub - mcneel/cycles: Fork from Blender Cycles (src/ccycles for the wrapper API around Cycles), and GitHub - mcneel/CCSycles: CCycles: a C API for the renderer Cycles. CSycles: a C# wrapper around CCycles. for csycles, the PInvoke layer and C# wrapper. This then is used by GitHub - mcneel/RhinoCycles: The Cycles integration plug-in for Rhinoceros 3D which is the RhinoCommon plugin.

Thanks Nathan. I’m not familiar with Cycles or Rhino Render. Does Rhino Render pass Rhino objects to Cycles?

What is the purpose of MFC in Rhino C++ DLLs?

I have no knowledge of C++ plugins, I have only ever done C# and F#, that is .net, plugins.

But RhinoCycles makes the necessary data transformation so that Cycles can use it. This processing is done in C#, then passed on the C++ via the wrapper C API and P/Invoke.

When doing a C# plugin you’ll be creating the GUI part with Eto.Forms, which Rhino itself uses for much of its GUI on both Windows and MacOS. RhinoCycles uses it for instance to provide the settings page in the options dialog for Rhino Render.

The Rhino C++ SDK is designed to be used in MFC DLLs. But you don’t have to use any MFC classes if you don’t want.

– Dale