Wish: disable Rhino geometry preview

Sure it is. If you work only in GH and use RH to view your stuff, while still changing your algorithm you need to see clearly and quickly hide all data (3d objects) that are just in rhino.

I use a custom display mode in Rhino in which nothing is visible (by turning off object shading, curve display, etc.). With an alias to change to this mode, one can easily “hide” ALL Rhino geometry and see only what is happening in Grasshopper, and then go back to normal display mode if necessary. To improve visibility I use two different modes: GhB (only GH geometry, black background) an GhW (same, but white background). This might work for your needs!

That should not be that difficult I think, using python. But the request was for a button in GH hardcoded and I support that it will be useful.

Yes ofc, I support the request. As I said: temporary solution.

1 Like

Blindfold already does referenced geometries. He means all Rhino geometry in general.

It’s not hard to make it hide all Rhino geometry, I can add it. But as I understand the wish is for a button in gh interface which I am personally not familiar with coding that (not sure that’s technically allowed unless Mcneel does it)

1 Like

He means all rhino geometry, not just reference

Until GH has that button or I add it to blindfold, you can do something simple like this with Lunchbox.


hideshow.gh (5.7 KB)

2 Likes

Hi Michael, adding that option for ‘all geometry’
would be great.

The reason I want this is because we are using GH to do retopology of Rhino geometry so we can start working from static regency geometry (Modo modeled, scanned data, burns models) and turn them into drivable GH geometry (mostly SubD).

We need an easy way to toggle on/off separately the Rhino Geometry and/or the Gasshopper preview.

It doesn’t make sense in this workflow to have to go to 2 different places to turn on/off visibility of ‘all our work’.

Sure, but also check out the Lunchbox version I attached above.

I missed that! I’ll check it out. Thx

it doesn’t work properly ,can you check it

I’m not having any issue with it.

Actually here is a even better way so you just control with one bool.


hideshow_one button.gh (7.8 KB)

thanks , i did something like yours and it worked fine

1 Like

This is a ghpython example that hides/shows geometry. Similar to above examples, it’s dependent on referencing geometry into a geo parameter. If no geometry is referenced, it hides/shows all geometry in the Rhino Doc.
GHPY_HideShowObjs
GHPY_HideShowObjs.gh (5.8 KB)
unoptimized code below:

"""Show/Hide Objects.
   Inputs:
       Show: Boolean.  Show/Hide Objects in Rhino Document
       objs: Geo.  Optional.  Referenced Geometry to Show/Hide.  If ommitted, all geo will be shown/hidden."""

__author__ = "chanley"
__version__ = "2019.02.04"

import Rhino

def HideAllVisible():
   settings = Rhino.DocObjects.ObjectEnumeratorSettings()
   settings.VisibleFilter = True
   AllObjs = [obj for obj in Rhino.RhinoDoc.ActiveDoc.Objects.GetObjectList(settings)]
   for obj in AllObjs: 
       Rhino.RhinoDoc.ActiveDoc.Objects.Hide(obj, True)

def ShowAllHidden():
   settings = Rhino.DocObjects.ObjectEnumeratorSettings()
   settings.HiddenObjects = True
   AllObjs = [obj for obj in Rhino.RhinoDoc.ActiveDoc.Objects.GetObjectList(settings)]
   for obj in AllObjs: 
       Rhino.RhinoDoc.ActiveDoc.Objects.Show(obj, True)

def HideRefGeo():
   for id in objs:
       Rhino.RhinoDoc.ActiveDoc.Objects.Hide(id, True)
      
def ShowRefGeo():
   for id in objs:
       Rhino.RhinoDoc.ActiveDoc.Objects.Show(id, True)

if Show == False and len(objs) == 0:
   HideAllVisible()
   ghenv.Component.Message = "Hide All"
elif Show == True and len(objs) == 0:
   ShowAllHidden()
   ghenv.Component.Message = "Show All"
elif Show == False and len(objs) != 0:
   HideRefGeo()
   ghenv.Component.Message = "Hide Ref"
else:
   ShowRefGeo()
   ghenv.Component.Message = "Show Ref"

A nice addition, as mentioned above, would be to ping the ghdoc, get the parameters with referenced geo, then get the GUID of the Rhino Geometry from those parameters.

3 Likes

A nice addition, as mentioned above, would be to ping the ghdoc, get the parameters with referenced geo, then get the GUID of the Rhino Geometry from those parameters.

Which is what Blindfold is doing, I find referenced GUID’s

I still have the question. If you show all, should everything hidden in rhino come back? Or should only what hid when you hid with gh come back? Say you had hidden stuff previously directly in rhino, then you hide all with gh to hide everything else not currently hidden, what should come back with show from gh? Everything? Or only what gh hid?

good point…I think it would probably make sense to store the current visibility state of all the objects before doing anything from GH?

But…maybe it doesn’t make sense to hide anything besides the referenced geo? From a workflow standpoint, maybe it makes more sense to manage “non-GH Referenced geo” directly in the Rhino doc? Not entirely sure…While I find these type of things interesting, I find myself questioning if it’s adding enough value…like I usually do after writing some script and then saying to myself, “this seems like a long walk…”

Also, I totally missed you blindfold plugin! Sorry about that!

1 Like

maybe it doesn’t make sense to hide anything besides the referenced geo

This was my thinking exactly when making Blindfold, mainly I made it cuz the overlay glitch of gh and rhino display drives me insane :smiley:
bf_image_4

maybe group visible geometries and show/hide this group ?

Well I would just keep track of visible Rhino object GUID’s in that case. The question is, is that the correct behavior? Or the most useful behavior?

Tried that for the script I uploaded, but got lost in the Grasshopper SDK. Can you share the Code for this part?