Grasshopper

algorithmic modeling for Rhino

Hi everyone,

I'm drawing some stuff with the DisplayPipeline class in my custom component. The problem is to turn it off. I remove the event handler certain component events.

For instance i managed to get it to work with the locked state of the component and if the component is removed from the document. But i haven't got it to work for:

1. The preview state:

here i tried the event on base.ObjectChanged... but it catches just changes on right click on the component to change preview state. If i turn the preview off with the middle mouse button menu or ctrl+q it's not throwing this event.

2. If the document has been closed
i've found this thread but this is not working in my case with the documentServer http://www.grasshopper3d.com/forum/topics/detecting-deletion-of-com...
is there any other option? or is this a wrong approach at all
Thanks in advance

Views: 396

Replies to This Discussion

Hi Florian,

components are already hooked up to the Display Pipeline in Rhino, you don't typically need to create new CustomDisplay. You can override the DrawViewportMeshes and DrawViewportWires methods on GH_Component. Just be sure to call the base class implementation otherwise you're replacing functionality rather than adding functionality.

You may also want to override the ClippingBox property on GH_Component to make sure your custom geometry isn't clipped.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

Thanks a lot. This was what i need. Strange that i didn't found it searching on the forum. This makes a lot more sense.

regards Florian

Hi David,

It's all working perfectly fine. But somehow it's not displaying anything if no geometry is set to an output of the custom component or in my Example no outputParameter is set.

Is it because the DrawViewport... will not be called in this situation?

Is there a way to call the DrawViewport... methods from solveInstance. I tried this but it's causing crashes :-( any suggestions

Thanks in advance 

Florian

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service