Plugins - crossplatform

Continuing the discussion from Plug-in for making exploded views:

just curious

so i assume plugins for mac will need to be specifically tailored to mac.
(is that right?)

using this plugin by david for example…
why won’t that work on mac too? how much additional work/knowledge by the writer would be needed to make it work on mac&pc?

are there possibilities down the road which will make it easy (or easier) for cross platform plugins? (like how python is… i can write a script and it will work on windows too.)


Well, if he has written it in C# , then it could be ported to mac like here possibly. I am just learning so don’t take my word for it, but it looks doable. I believe he would have to make an rhi file to do a cross-platform.

I got it on my Windows box, but I didn’t have time to play with it yesterday, Only tried the Trajectory command once.

Assemblies that use only standard framework assemblies and RhinoCommon should work on both Windows and Mac without modification. That is, the the same binary should load and execute you shouldn’t even have to compile two versions.

If you want to use custom UI (windows and buttons) then you should not use WPF or winforms or some such, but instead use Eto, which is a cross platform UI we support on both operating systems. Again, the goal here is to have the same binary run on both Windows and Mac.

I haven’t tested my aforementioned plugin on Mac yet though, I haven’t been keeping up with the progress of RhinoForMac plugin support, though I think the most recent release should be able to handle it.

1 Like

It should work, there are 3 plugins for mac on the Food4Rhino site.

It depends. Yes, normally.

This is a great example. It does work on OS X, with zero code changes. Here, give it a try…ExplodedView.macrhi (12.4 KB) - UPDATED on 11/4/2015

How much additional knowledge? That depends on the scope of the plugin. In the case of ExplodedView, very little additional knowledge was necessary to get it to work in Rhino for Mac. All the necessary information to do that is here. The important part to note is that David did not have to make any changes to his code…as long as he is writing using C# and making calls with RhinoCommon, getting it to work on Mac is trivial.

It can always be easier :wink: I guess I don’t understand this question, because it does work. If you’d like to know how, start here.

Stepping back a little…David says:

At the moment, you do have to compile two versions, but they are essentially the same. (We’re currently working on some approaches that could make it easier to “just use the same binary.”) That said, the amount of work needed to compile on each platform is very small…and there are many good reasons that you should compile on each platform anyway.

Thanks @dan will do. Glad to hear it all goes fairly seamlessly.

I like to think of them as “beautiful seams.” :slight_smile:

1 Like

ha. i just didn’t realize it worked… (or- i thought a mac plugin might need an entirely different type of coding than windows.)
or- it seems easier as is than i expected it to be.

thanks for the macrhi version… install was easy and as you say… it does work. neat!
i’ll read through the link… haven’t seen that before.

I’m glad you asked. We need to do a better job of communicating about cross-platform plugin development in general. Our focus has been getting third-party plugin developers up-to-speed…and there is still work to do on that front.

We’re really enamored with Eto too - as David mentioned above - because if you are using Eto, you can do your UI cross-platform.

Normally, it would be, but we’ve worked really hard to get this working …and are continuing to put in lots of effort on this front. At the moment, we’re working on documentation and samples for taking plugins that have core logic written in C/C++ and wrapping them in C# (because we are not providing a C/C++ SDK in Rhino 5 for Mac; nor are we providing an Objective-C or Swift ones).

C# and RhinoCommon are the way to go.

Some good examples on using Eto, other than what is on their GitHub site would be really useful. I must admit i haven’t played with it much. I am hoping to do some jewellery plug in stuff.

Thanks again.

It’s on our TODO list to get these samples and guides up soon. In the meantime, the Eto “kitchen sink” sample is really awesome. Also, if you run into problems, @mention @curtisw - the author of Eto - in the Rhino Developer category.

Thanks, I will check them out.