Visualizing custom hierachical objects

Phew, I’m pretty sure this is either not possible or really complicated using python. I have looked for a way to implement preview behaviour of custom python types myself in the past and didn’t really end up with a working solution. Some thoughts and hints on this anyway:

  • If I remember correctly the display behaviour of grasshopper datatypes ist determined by the methods DrawViewportMeshes and DrawViewportWires but it is not really possible/feasible to overwrite these on custom python types (please someone correct me if I’m wrong, this is from memory).
  • Grasshopper components also implement the same methods. The component methods can be overwritten using python, so you can control the drawing of the preview for the python component but only if you use the new GHPython SDK mode. An example can be found here: GhPython add-on compiler with example

Hope this helps in a way. I’ll be glad to know if you find a way to implement it also on the type/object level. Let me know if you need a sample file for the mentioned workaround.

1 Like