[v8] Custom Curve Preview bug - does not draw curves after load/save

I have one Custom Curve Preview component connected to a set of curves, and it displays these curves with the chosen color and linetype.

If I then duplicate this component by Alt-dragging, and connect it to another set of curves, these curves are not displayed. If I drag a Custom Curve Preview component fresh from the toolbar and connect it to the second set of curves, it does display these curves.

The same problem occurs when the components are saved to GH file, and re-opened: then they won’t draw curves anymore. Looks like there is an error in serialization/deserialization of this component?

Looks like the linetype parameter is at fault. After deserialization its value is reported to be Model Linetype : Continuous (what I chose when I configured the component), but it is not selected in the list. When I manually select it in the list, the component draws again.

image

image

1 Like

Similar problem here : the "Custom curve Preview component randomly “forgets” which linetype was previously selected and the component is orange when I re-open the file.

Also, if I input a text with the name of the linetype, then the thickness that was set in the said linetype is ignored.

To summarize : this component sucks.

I just tested this with the latest internal dev build and it should be serializing the linetypes correctly. We did make a change about a month ago which might have fixed the issue you’re seeing and how persistent data was handled in certain parameters. Can you update to the latest weekly service release and see if this same issue is happening for you?

The problem with serialization has been solved indeed see my next message for errors with serialization, but the behavior is still not what I expected, this is on 8.6, not the weekly SRC.

Steps:

  1. Open Rhino, draw a curve
  2. Launch Grasshopper, drop curve component, connect to curve just drawn.
  3. Internalize data on curve component, and delete curve from Rhino document.
  4. Drop custom curve preview component
  5. Connect curve to custom curve preview
  6. Attempt to set line type

Result: there is only one line type to choose from:

Next, go to Rhino document layer panel, and set line type on default layer.
Return to Grasshopper, and attempt to set line type.

Result: now all line types are in the chooser:

Hmm… When I save the document, restart Rhino and open the Grasshopper definition again, I also get this unexpected error:

I was expecting that the line types available from the component would just be a set of line types that you could choose from within Grasshopper, completely unrelated and separate from the Rhino document.

Here, on (8.8.24106.18001, 2024-04-15), I get this:
image

I can reproduce this → RH-81555 Grasshopper: Custom curve preview forgets linetype

For that case, you need to construct a linetype in Grasshopper first.
image

-wim

1 Like

I still see this on version 8.8.24106.18001, 2024-04-15 (even after a Factory Reset)

image

Also, a bit related, I see the behavior below, a hint to add a name to create a model line type. But this hint only appears if the numbers are connected from a separate number component. If I set them directly on the model line type component, the hint does not appear. Also, I expect not a hint, but a warning: the component does not produce a model line type without a name.


:point_up: has hint
:point_down: no hint if I set segments directly on the component

@osuire @menno @wim Ok. I think the primary issue here is that the reference to the linetype is being lost because people are not opening the same Rhino document with their Grasshopper definition. Let me illustrate with an example. Let’s say you have a curve parameter in your Grasshopper definition. You right-click on the parameter and select “Set One Curve” where you then pick a curve from your Rhino file. You then save your Grasshopper file and close the Rhino document for the day. The next day you open a new Rhino document and then open your Grasshopper file. In that case, your curve parameter would throw a warning telling you that it could not find the referenced curve because you’re using a new Grasshopper file and the curve it’s looking for isn’t in the new document. Well, the same thing happens here with the linetypes. If you select a center linetype from the list… it’s going to reference the center linetype from a specific Rhino document. If you then open the Grasshopper file, but don’t use the same Rhino document from before, then the reference will be lost. Does this make sense?
I just test this behavior and everything is working as expected in the latest Rhino service release. Please let me know if you see something different on your machines.

1 Like

The reason you’re only seeing one linetype is because brand new Rhino documents do not create the standard default linetypes and/or hatches. It was done this way to save the file size of Rhino documents in case you didn’t need to ever use linetypes and/or hatches. To get the standard linetypes and/or hatches to be loaded, you simply need to load one of the Linetypes or Hatches panels, or go to Tools → Options → Linetypes for example. This will then load the default set of linteypes for you and when you go back to your GH definition and hit F5 to recompute your definition, you should then be able to see the full list of linetypes in your parameter.

1 Like

This seems like if could be a bug. If you could please make a YT for me, I will try to track down what’s happening. The name issue is done correctly. We wanted to make the user aware that a name is needed before a linetype (or really most data types) can be added to the document. It’s shown as a grey “remark” instead of a warning because it should still output a valid linetype that you can use in your GH definition. You just wouldn’t be able to push the linetype to the document with the Content Cache component without having a name. In this particular instance, it looks like it’s not actually returning a linetype until a name is set, which shouldn’t be the case.

Nope.

Ok. If you open this Grasshopper file along with the Rhino file, does the linetype show up (it should be set to Center).
CurveDisplay.3dm (37.6 KB)
CurveDisplay.gh (3.1 KB)

Are you asking me to check what I have already checked with my own files and with my own eyes ?

https://mcneel.myjetbrains.com/youtrack/issue/RH-81577