I was able to replicate this behavior, basically Rhino will load grasshopper, but if I unload (-grasshopper_unloadPlugin) then launch grasshopper again, I get the following error and Rhino crashes.
Hi Matthew - thanks, I’ll check that.
Hmm - so far all OK here.Can you reproduce it just on opening GH, with no file loaded, and then unload and restart? Or does GH need to have been up to something when closed?
I’ve been able to duplicate without opening any file, just: load, unload, load.
Hi Matthew - what plug-ins, if any, are you running in GH?
Dungbeetle is probably part of the problem, its a plugin I’m working on writing… So far its just a placeholder though, there is almost no code within it. However, I am using the python GH_Component SDK Mode to write it.
It seems like the unload command maybe isnt fully unloading the custom plugin’s python? So when it goes to reload it snags?
Ah. The truth comes out! =) .
I’d check in with https://discourse.mcneel.com/c/grasshopper-developer
I’ll switch this conversation over there…
@piac, the exception message seems to talk about some python type casting problem. Do you know anything about this? Is it a version mismatch problem?
I’ll study what happens in detail with this unloading tomorrow. I did not test it.
It’s possible that some additional operations need to happen when _GrasshopperUnloadPlugin is invoked. I cannot tell now if it will be possible to fix this.
Incidentally, there are stringent prerequisites for this particular command to work, also for C# and Vb.Net plug-ins. I never managed to use it for Weaverbird, for example.
Yeah it’s not really all that useful a command. For one it doesn’t actually do what it claims it does, so if it’s really causing trouble I think the correct advice would actually be “don’t run the command that makes your computer crash”…
I am working with David on having this command not crash Rhino. It however looks like it will not be useful, at least not in the combination with ‘Memory Load COFF byte arrays’.
Right now, as any number of GHPY assembly can coexist, my suggestion would be to simply give new versions a different Guid and a different name, and not use _GrasshopperUnloadPlugin.
We will keep you posted regarding developments.
To aid with the not use of this command I helpfully removed it.
I just discover this is dropped.
So now if I want to add a new plugin, do I have to close Grasshopper and Rhino and restart it again to allow grasshopper to recognise the new plugin?
No, any gha dropped into Grasshopper will still be copied to the Libraries folder and loaded immediately.