Happy Birthday, @nathanletwory !! (That was indeed the red cake next to your name on Sunday, right?)
I managed to get your example working, but I’ve completely given up on trying to run my own tests with a Rhino plugin.
As a user who writes commands or Grasshopper components to assist in my work (often temporary and for specific projects), it’s been years since I stopped writing plugins for my tools.
Rhino still uses the system registry as a personal database. There’s no way to uninstall a plugin without manually tinkering with the Windows registry. I create dozens of commands or components each year, and I don’t want all of that recorded by default.
For the topic at hand, creating a plugin for three lines of code for a test is truly inconvenient. The Yak package system is great, but again, it’s not designed for writing small tools or running quick tests.
Nowadays, with tools like Visual Studio, Chrome, Blender, etc., launching specific instances is as easy as specifying a configuration directory on the command line. With Rhino, this is still not possible.
We’re either developers, jewelers, architects, marine designers, or concept artists—meaning we’re always stuck with (1 system registry == 1 Rhino == 1 Activity).
But when I’m developing, I don’t want VisualArq loaded; when I’m doing architecture, I don’t need XNurbs. Each time I change how I use the software, I either have to go into the registry or block the plugins from loading in the options and then restart Rhino.
In any case, it’s not practical for me as a user. So, I resort to workarounds, like creating fake plugins that I then use in my scripts or resorting to System.Reflection
to use internal functions and load Grasshopper components.
And all this is no more complicated than creating a temporary plugin to allow scripts to register temporary commands, components, or textures, or simply changing the internal
keyword to public
. (And from experience, this hasn’t caused any issues for quite a while…)
Of course, this isn’t about you personally, Nathan. The Rhino loading system has been around for a long time. I’m mainly writing this to raise awareness of this inconsistency: on one hand, plugins require assemblies to load on startup, while shiny new tools like ScriptEditor can’t load commands, components, or textures.
As with commands and components, I was ready to use workaround methods to load RenderContent
. When I looked at the RegisterContent
function, I saw there were quite a few steps and several registry updates required. It seems too risky to try hacking it.
But I realized that if you exposed the following function, it would solve the problem:
public static Type[] RegisterContent(IEnumerable<Type> renderContentTypes, Guid pluginId)
This would simply enable the loading of RenderContent
associated with a plugin, rather than only from DLLs.
I hope all this feedback will be useful. My current project will be modeled in Rhino 7, and I’m not expecting any updates, so for now, I’ve given up on using RenderTexture
…
Best regards,
jmv