Plugin on Mac

Hi all,

I am trying to understand how rhp works on Mac.

  1. How/where Rhino finds/loads the plugin?
    From this document (https://developer.rhino3d.com/guides/rhinocommon/uninstalling-plugins-mac/), it seems ~/Library/Application Support/McNeel/Rhinoceros/MacPlugIns/ is the place that Rhino loads plugin from. Is this the only place? or plugin can be loaded from a path that is added in something like Mac’s version of Registry (Rhino - Registering Plugins (Windows))

  2. How does Rhino load plugin from Visual Studio’s debug mode?
    I am trying to test plugin in Mac’s Visual Studio, I found there are two items in plugin manager, and I checked each details, they are the same GUID, and file path. Plugin is still in plugin manager even after I removed rhp from the original path (on Windows, plugins will be unloaded if rhp is removed).


cc @dale

Thanks,
Mingbo

@dan, is this something you can help with?

Hi Mingbo-

I apologize for the delayed reply! Hopefully this is not “too little too late.”

Yes, Rhino for Mac attempts to load third-party plugins from:
~/Library/Application Support/McNeel/Rhinoceros/MacPlugIns/

This is a Rhino version-agnostic folder. In other words, the Rhino for Mac macrhi installer (as imperfect as it is), unpacks all plugins into that folder. Each major version of Rhino for Mac attempts to load them if they are compatible. If it can load them, it adds the path to a sort of “quasi registry” which is contained within the preferences file with caveats (see *below).

Are you using the RhinoCommon Visual Studio extension? The reason I ask is because:

I found there are two items in plugin manager, and I checked each details, they are the same GUID, and file path

Yes, this is likely happening because each of those plugins are using the same GUID. This leads me to believe the templates in the RhinoCommon Visual Studio for Mac extension were not used (as is sometimes the case). In this case, you’d need to change the GUID. Now, since these are already registered with Rhino for Mac, you’ll need to disable one of those two, or reset preferences to delete the “registry” of the path.

That might be a bug, but we’d have to reproduce what you are seeing there to figure that out. Before you reset preferences, you might want to export them and send them our way if you’d like us to investigate that.

Stepping back a little, there are a number of flaws with macrhi installers and plugin loading that we’ve had trouble addressing while maintaining backward compatibility with existing plugins and installers. For this reason I think it is also important to say we are working on a Package Manager in Rhino 7 that we hope will work around some of these limitations. Just thought I’d mention it.

Clear as…mud?
-Dan


*The caveats/flaw: Rhino 5 for Mac and Rhino 6 for Mac shared a preferences file (so if a plugin was compatible with 5, but not 6, this was an annoyance because the user was warned every time the plugin attempted to load that it was not compatible.) With Rhino 7 onward, we have since separated out the preferences by major version, so we hope that helps with this problem.

3 Likes

Hi @dan,

Thanks for your reply, not late at all. This week we have been working on making all grasshopper components work for Mac, and so far we have made all Honeybee’s energy simulations working on Mac’s Grasshopper from end to end.

For RhinoPlugin (we are only targeting Rhino 6 onward), I think this Mac’s Preferences file explains all my questions I have so far. I will keep you posted if I have more questions.

Thanks again,
Mingbo

2 Likes

Hi @dan

I am getting back to Rhino plugins for Mac.

I am doing a little bit more investigations on this issue with .plist file.

First, I don’t find any of my plugin info in the plist that I exported from Rhino by “ExportPreferences”. However, when I use an online plist decoder tool to convert the original com.mcneel.rhinoceros.plist, I found the plugin path is still there:


and I searched the plugin’s GUID, I found these data related to plugin scattered in this plist file.



So my guess is, when Rhino loads this com.mcneel.rhinoceros.plist file, it doesn’t check if any plugin has been removed from original location, and then remove the pluginRegistry from this plist. Or Rhino does all above steps, and just doesn’t save the new plist. @dan please let me know if you need anything from me to recreate the issue.

===============================================================================

To me, this com.mcneel.rhinoceros.plist is similar to Windows’ Registry.

On Windows, we can register plugin by adding it’s path to HKEY_LOCAL_MACHINE\SOFTWARE\McNeel\Rhinoceros\6.0\Plug-Ins\F3CF4A28-EA9E-4E08-BABA-5FC6645A5D72 , and Rhino on Windows will check this path when it loads.
Remove plugin from the original path, Rhino will update this registry next time it is trying to load, and remove it from registry if it cannot find rhp. Or we can remove the plugin directly from registry, which de-links the rhino and plugin.

So on Mac, guess Rhino does the similar thing to plist. What’s the best process to register a plugin, is saved somewhere else instead of ~/Library/Application Support/McNeel/Rhinoceros/MacPlugIns/, to plist?

To give you some background that why I want to register plugin to plist directly on Mac: we are building an installer to install our rhino and grasshopper plugin along with all required simulation engines and libraries, I need the rhino plugin registered/unregistered within this installer/uninstaller.

Thanks again for your helps,
Mingbo

@JohnM Can you help with this one?

Working on an answer with @stevebaer on an answer, Steve hooked the Mac stuff up.

I logged RH-59103 to reference this issue.

1 Like

Hello Mingbo,

The problem with plug-in’s showing up in Rhino/Preferences/Plug-ins has been resolved in RH-56834 in Rhino 7. There is a good article that may be found here that discusses plug-in installers for Mac and the location Rhino uses to look for plug-in assemblies.

Hi @JohnM , thanks for following up, and glad to hear this has been solved in Rhino 7.

We are building our own installer to install Rhino plugin with other simulation engines. I think my question is what is the right way to add (register) Rhino plugin’s path to com.mcneel.rhinoceros.plist file?
Do you have any recommendations on how to edit plist files?

Mingo,

Have you considered using the Rhino installer engine to install your plug-in? It can be used on both Mac and Windows.

@JohnM the reason we are nor considering Rhino installer engine is we don’t want users have additional manual steps to install plugins. Or is there a way to use Rhino installer engine by command line?