Mac Rhino plugins


#1

Is there, or will there be, any provision in Mac Rhino for Xcode/Cocoa plugins like there is in Win Rhino for C++ and .Net plugins? Or is Python about it?

And if it’s just Python, what do we use for dialogs and other resources? Can Python use Cocoa?


(Steve Baer) #2

Eventually we will have an SDK for plug-ins. One of the points for writing RhinoCommon was to allow it to work on both platforms (hence the use of the word common.)

You actually can write .NET plug-ins for Mac Rhino right now, but the process is so convoluted at the moment that we need to make a lot of little tweaks to make it so people can actually develop there in a productive manner.

We have been experimenting with writing plug-ins that contain native UI for Windows and OSX. One recommendation I can give is to learn WPF and the MVVM pattern on Windows if you are interested in writing UI in your plug-in that will be easy to post port. This turns out to be the approach that allows for as much shared code between the different versions of your plug-in as possible. On OSX, the UI would be designed in Interface Builder (part of XCode) and could be hooked up to the same ViewModel class that you write on windows making only the actual user interface widgets different, but the same logic underneath.


#3

OK, Steve. Thanks. I’ll take your WPF/MVVM recommendation as good advice.

I don’t think you gave a direct answer to my question about whether Python for Mac can use the Cocoa, Foundation, Appkit, etc. frameworks?
My inexperienced assumption is “Sure, why not?” (I’ve been trying to spend some time to get familiar with Python but have yet to write my first program)


(Steve Baer) #4

Probably at first custom UI will be easiest with a language like c#, but eventually it should be also relatively easy to do the same with python.


#5

Hello everybody,

I would like to suggest me a cross platform solution. I’m planning to update a plugin that can be available for both Rhino Pc and Mac edition mainly for the UI part.

As far as i can understand, only python is cross platform and partially mono (C#). I’m thinking of updating an already done plugin, built with C++ SDK, so as to be available on Mac edition.

  1. Any suggestion on how to move with C++ ?
  2. Will be a good idea to replace MFC with Qt Framework so as to achieve cross platform UI or it’s not possible ?

Thanks in advance !


(Marlin Prowell) #6

A word of caution here. Rhino for Mac has it’s own Python interpreter and is not using the Python interpreter that comes with OS X. We did this so we could guarantee compatibility between the two platforms.

Apple has some bridge libraries that let you use the different frameworks, but Apple did that work with the OS X version of Python. When you find documentation on Python, Apple, and Cocoa, this is most likely the environment that is being described.

We are using Mono and IronPython inside Rhino for Mac, so it is the Mono -> Cocoa bridge libraries you should be looking at when investigating how to get at OS X frameworks.

It may well be possible to use Apple’s Python Cocoa libraries from inside Rhino, but we have not tried that.


(Marlin Prowell) #7

There is no published C++ SDK for the Mac version yet, so this is not yet possible.


(Steve Baer) #8

It depends on how much C++ code is involved. In some cases it would be pretty easy to convert the code to C#. As @marlin pointed out, we don’t currently have any published C++ SDK.