Squid: Read bitmap format failure

I am using the Shapediver version of Squid and on one machine I keep getting a serious error with the read bitmap component.

As soon as I connect a quick preview to the read component I get either of these 2 errors. The file path component has a path to a normal image on my C drive in it:

after pressing ok:

Or when you hover over the B output you get the follwing error:

and if you select to not show the message again you can see on the B pin:

This doesn’t happen with normal version of Squid, but I need to use this version as only this is compatible with the ShapeDiverImageSampler, which I need.

But also it doesn’t happen on my other machine, only on one, even though the Rhino version and all Grasshopper components are identical.

But somewhere in the Shapediver version of Read bitmap it handles something very ungracefully and makes everything fail. Once you had the format_failure error even if you delete and reinsert the component the error persists till you reopen Rhino. Since it fails right at the start though, I can’t use anything from Squid (ShapeDiver edition) on the other machine.

Any reason why this is happening?

Alternatively is there an image sampler that works with the normal version of Squid @MateuszZwierzycki? Something where I put in a SquidImage and a bunch of UV points and it gives me the color value at that point? The native GH image sampler is okay, but not very parametric (everthing has to be set via UI), so is not good in this case.

I can’t reproduce this problem on my laptop, it’s the first time I hear about it. Does the problem only affect the quick preview? In other words, does the ShapeDiver Image Sampler still work?

Anyways, you might be able to fix the problem by downloading the newly released version of the plugin:

Make sure to delete all ShapeDiver and Squid related files from your Components folder and then run the installer. You might also need to uninstall the previous ShapeDiver plugin if you used the 1.5 installer.

Let me know if that solves the problem.

I tried that, but now on both machines even the one that was working fine, after installing version 1.6 of Shapediver I get loading errors for all the image nodes during startup of Grasshopper and then those components are not available…

The image sampler also didn’t work (but didn’t throw an error), because it had the same input of “format_failure” coming out of the read component.

Oh and please stop this ridicolous trend to have the Grasshopper plugins in the installed folder and not in the components folder, like all the other plugins. It makes it so hard to find where it is being loaded from. Especially since you don’t have an updater for Shapediver anyways, but you have to manually remove the old version and then install the new. Why not just copy them into the components folder?

The update to version 1.6 is a little cumbersome, depending on which version of ShapeDiver and Squid you were working with previously. The idea from this version onwards is to have all dependencies managed together by the installer. This will make it easier in the future to update the plugin. I agree that having an updater will make it even easier.

You can easily find where the plugin is loaded from by opening the ShapeDiver.ghlink file in the components folder with a text editor. It contains the directory where the plugin and all its dependencies are installed.

The errors you are experiencing are typical if you have duplicates of the plugin files in a different folder. If you have successfully uninstalled the previous version before installing the new one, please double check that you have removed all ShapeDiver-related files from the components folder, in particular GrasshopperBitmap.dll, BitmapComponent.gha and ShapeDiverSquid.gha.

Correction. It turns red and says “invalid parameter” actually. I uninstalled Shapediver 1.6 and went back to the old version 1.5 on both machines and the behaviour is as before.

It should probably say that during the installation.

The problem with this situation of having your own version of Squid (but grasshopper thinks its the same) is, that if I get a definition from someone who used Squid, it will show me an error and that it can’t find the components. So if I have to download the proper Squid and put it in my components then during loading I will get a warning that the same plugin tries to load twice. Now its really hard to debug where that second version is, because GH doesn’t show the whole path to the 2 versions its trying to load. Also I can’t use the “delete” function to delete the Shapediver version of Squid.

So please please please, either fork Squid and rename it or at least make sure you can have Shapediver Squid and Squid at the same time or make them so similar that it works with either. Right now its like the worst of both worlds (ie. I can only have one of the 2 installed, but definitions with 1 dont work with the other, plus you have now made it a lot harder to know where to remove it because you have a “ShapeDiver.ghlink”, but not a “ShapeDiverSquid.ghlink”, which means after like a few months you don’t necessarily remember that Shapediver also includes its own different, but not compatible version of the Squid.) I’m just saying the user experience of managing plugins in GH is already not great, but you have now made it harder.

Anyways, went back to 1.6 on both machines, deleted the old files and it seems like its working now. Phewww, what an ordeal ;D

It would be ideal if we could have a single version of Squid, however our version relies on ShapeDiver dependencies which would not make sense for Squid to include at the moment. This is something we could discuss with Mateusz in the future.

However, I think all compatibility issues were coming from the different versions of ShapeDiverSquid on your machine. Theoretically, there shouldn’t be any problem having both plugins installed. I actually have both on my laptop without issues. Now that you seem to have a clean installation, you can try to reinstall the regular Squid in the components folder and see if it works.

You’re right, it does work now to have both. Great.

I noticed that you changed the datatype that your version of Squid uses. How come? Squid uses “SquidBitmap” and you use “GrasshopperBitmap”.

There are several reasons for this. The more technical one is that we enriched the data type to make it more Grasshopper-friendly. When you install ShapeDiver, it comes with an additional Bitmap primitive type:

If you right-click on a bitmap component, you can set a local file directly and the internalize it in the definition. You can also use it in C# and Python scripts within the definition.

Additionally, this primitive is used in ShapeDiver components (image sampler, image to mesh, and as texture inputs in material components). It can potentially be used in other plugins as well. In that regard, it made sense to give it a more generic name.

1 Like

You can also use it in C# and Python scripts within the definition.

Can you give an example of how to use the Bitmap Component in a C# script? I would like to generate a Bitmap using System methods and output a GrasshopperBitmap type.
I’m curious both about what methods there are for casting to or generating the GrasshopperBitmap type and how to do so in a way that will work in a C# script on the ShapeDiver platform. (maintain references to whatever assemblies are required).

(note: Usually this forum is for troubleshooting questions, but since Mathieu is a Shapediver rep it feels appropriate to ask the more open-ended request for an example).

Thanks!

Here are a few custom C# bitmap components we have developed for ShapeDiver applications. I hope this helps and let us know if you have any questions.

C# Bitmap Components.gh (12.9 KB)

Thanks! I also discovered that System.Drawing.Bitmap casts to GrasshopperBitmap.