RhPicture extension not working in V6

Hi @DavidRutten,

We can’t get the RhPicture to work in Rhino 6.
Is there any reason for it not to work as it used to?
The RhPicture.rhp plugin installs with no problem (reports passing compatibility test) but then we are unable to assign the plugin object to a variable, getting this error:

Option Explicit
Call Main()
Sub Main()
	Dim RhPicture
	Set RhPicture = Rhino.GetPluginObject("RhPicture")
End Sub

image

The same works fine in earlier Rhino versions (V4, V5).
A lot of our tools and workflow depends on its functionality. Hope we can keep using it in Rhino6 !

thanks,

–jarek

RhPicture.rhp (88 KB)

This plugin uses the old, deprecated Rhino_DotNET SDK. It’s still kinda sorta shipped with Rhino6, but I’m guessing we removed the GetPluginObject functionality, or perhaps changed it in ways that broke ancient code.

@stevebaer @dale am I correct in thinking that?

I added this to our bug list at https://mcneel.myjetbrains.com/youtrack/issue/RH-46591

I can probably get it to work again, it will take some debugging to figure out what is going on.

Thanks David, good to know. Hope this can be salvaged or fixed soon.

It kinda sorta breaks the major functionality of my Armadillo and Flatworms plugins under Rhino 6, I am already getting reports from users that switched to Rhino 6. Plus, bunch of our in-house, unpublished tools that rely on it. Maybe it is ancient but has been extremely useful for anything image-processing related with RhinoScript.

If this is a Rhino 6 fix, great, will wait for the SR fix to come out. If RhPicture itself needs to be fixed, I would need to re-distribute it to my plugin users.

I was actually hoping this set of tools will be incorporated into Rhino 6 with no need for external plugin (or ship by default as part of Rhino 6). So far it went the other way :wink:
@Steve - if you need cookies to put it high on your list, let me know what kind you like…

–jarek

I was able to fix this so RhPicture will load and work in Rhino 6. This will be available in SR7 (first release candidate will be available in a couple weeks.)

Works like a charm. Just got the daily build and tested.
Thanks for fixing it so quickly. Cookies on the way…

-j

Hi @stevebaer, @DavidRutten,

There seems to be a small problem with RhPicture plugin under Rhino 7.
It installs OK via drag-and-drop and works correctly, but it will not stay installed - meaning: it will not show up on the plugin list via Tools>Options, and also the next time Rhino starts the plugin is not there, and needs to be installed again, in order to work. Is there something that can be done to make it work again like it did in previous Rhino versions?

thanks,

–jarek

Is there anything unusual about the folder that you are dragging and dropping from?

The path typically is: C:\RhinoConfigs\Plugins_V7 (tried on a few machines)
This system worked fine for all other Rhino versions, do you think this could be a problem? I did not test other locations yet…

I just tried from a location on my Desktop, same problem…

It was just an initial guess in case you were doing something like dragging from an email client…

We store the path to the plugin in the registry and use that to load the plugin in the future. It sounds like somehow this information isn’t properly getting saved in the registry.

Could there be anything specific to RhPicture plugin? I’d be happy to test anything else but not sure where to start.
The issue is one of my plugins, Armadillo, relies on the image processing functionality of RhPicture, so Rhino 7 users will have this problem with Armadillo plugin as well if RhPicture can’t function properly (or al least it would be a nuissance to have to drag it every time new Rhino session starts…)

RhPicture is a seriously tired old plug-in. It might be better to help you add what you need to Armadillo. RhPicture is really a wrapper around some System.Drawing routines in .NET.

I’m bookmarking this post for now and will try to find some time to try and repeat what you are seeing with RhPicture in V7.

Yeah, I know, Armadillo is also a bit tired and old, but still has a lot of active users.
By tired and old I mean it’s RhinoScript based, and I don’t see a chance to do a rewrite in near or even distant future, other than maintenance and some small upgrades to use SubD etc.
So the simplest way to help would obviously be making sure we can continue using RhPicture, or similar functioning plugin, which literally just reads pixel info from images into an array, I don’t even remember exactly what would be needed but definitely not all of what RhPicture does. If you tell me we can’t make RhPicture work in V7 then I’ll start researching alternatives. Thank you for taking a look!

–jarek

Am I correct in understanding that the plugin works once right after you install it, but does not work again after you restart Rhino?

yes, works well, just doesn’t “stick”.
Also doesnt show on the installed plugin list.

I logged the bug at https://mcneel.myjetbrains.com/youtrack/issue/RH-65100

1 Like

Hi @stevebaer, looks like the same issue came back in V8 - RhPicture would not install. I made a more detailed report on this YT item from the past:
https://mcneel.myjetbrains.com/youtrack/issue/RH-65100
I hope there is a chance for a similar fix you did in V7…

@stevebaer I just saw the YT item was closed completely (got excited for a second since email notification said “resolved” but instead it just looks abandoned. Am I reading it right? It would be great if you could let me know the possibility of keeping the original RhPicture installable/usable.It will have serious implications both for Armadillo users and on our inhouse production moving to V8.

thank you

@Jarek - you can use RhPicture.rhp in Rhino 8 if you launch in .NET Framework mode:

"C:\Program Files\Rhino 8\System\Rhino.exe" /netfx

For example, this work:

Option Explicit

Call Main()

Sub Main()
	Dim RhPicture, objPicture
	RhPicture = "ee942655-a720-4b9b-844b-de4427f6fe0a"
	
	On Error Resume Next
	Set objPicture = Rhino.GetPluginObject(RhPicture)
	If Err Then
		Call MsgBox(Err.Description)
		Exit Sub
	End If
	
	If objPicture.LoadImageFromViewPort("Perspective") = True Then
		objPicture.ShowImage("Perspective")
	End If
	
	Set objPicture = Nothing
	
End Sub

Note, RhPicture will not work in .NET 7. And, its doubtful it will work in Rhino 9.

Also note: this plug-in was written for Rhino 4.0 using the obsolete Rhino_DotNet SDK.

If this tool is valuable to you, then you should really find an alternative. Most, if not all, of what this tool does can be done in Python using Eto.

Not sure why you can’t see these comments on YT…

– Dale