Context Bake bug

Hi everyone!

I’m attempting to create a script for Grasshopper Player that generates new walls and connects them to existing ones. However, I’ve discovered that the Context Bake component appears to function only on a single object at a time.

Here, you can see two wall objects whose geometry needs to be replaced with a new one. In a grasshopper test I have two objects and two replacing geometry.

However, it only works for the single wall. Here you can see baked result from Grasshopper Player. I attempted to reverse the objects list, but they just switched their sides, and one wall remains not replaced.

I recreated simple test and tried to replace 3 boxes with spheres, so the only first being replaced:

grasshopper-player.gh (11.1 KB)
test.3dm (3.0 MB)

Just open a rhino file and run .gh file in player

Is this a bug or I missing something?

my first thought is that you might be missing something :slight_smile:
I’m not a superuser of the new Rhino components yet, just studying them from time to time, but if you reference one Model Object (from a layer or whatever) then you change the geometry linked to that single Model Object with multiple geometries, you of course Pushing it will repeatedly overwrite the very same model object and only the very last one will show up in Rhino

simple example, the Sphere gets overwritten by the first box, then from the middle one, then from the top one, and that is because you are rewriting the very same Model Object the sphere was:

overwrite_same_model_object.gh (12.2 KB)

posting screenshots insted of a gh file didn’t help either :smiley:

Thanks for reply

I’d share a script but there are 300 nodes which may bring more confusion, so I made simple test to recreate a problem which you can see at the last screenshot :slight_smile:

No, in my last test with cubes, I used three different objects and provided for each new geometry. The Content Cache component works well and replaces both objects. However, I can’t use CC with Grasshopper Player because it overwrites objects in real time, creating a mess. Additionally, it makes the viewport laggy since it updates each millisecond.

Sharing the simplified Grasshopper definition might help…

grasshopper-player.gh (11.1 KB)
test.3dm (3.0 MB)

Just open a rhino file and run .gh file in player

Any workaround?

I’m have never used the Grasshopper Player before.

The definition seems to only bake one object every time it runs.

It sounds to me that you need to use the content cache. Check if this works for you

grasshopper-player boxes to spheres.gh (12.5 KB)

You should not be constantly pushing in such a case. Only display a preview while the user in providing inputs for your grasshopper player command and keep your content cache at the end of the script with a simple boolean gate

Thanks I currently have to use ContentCashe, but it reduces viewport performance while script is active, unfortunately.

Will look into some custom code solution, but I hope this bug will be fixed once

Try replacing the content cache with a context bake component, it will work exactly like a push but only execute at the end of the command. I faced a similar issue as you described (speed issues, the original object being lost if you exit the command, etc) and I solved it by using context bake. It works exactly like the content cache when you give it a model object with an existing GUID.

EDIT: I just noticed you are using Query Model Objects and not the Grasshopper Player’s ‘Get’ Components. I think that is what is causing the issue… If you used Get Geometry instead that it will work fine and bake all three spheres with the added caveat that you will have to manually select the boxes each time. This is strange. Even if its not a bug, this doesn’t feel like intended behavior.

Hi @nickonimus,

This will be fixed on next 8.22 RC of Rhino.

2 Likes

Yeah I need to select all walls from a level therefore I use a Query Model Objects, but I did a trick using blocks and now seems works well, but not tested enough yet.

Excellent, thank you!

RH-88605 is fixed in Rhino 8 Service Release 22

2 Likes