Wish: disable Rhino geometry preview

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?

Are there any plans for GH 2 to be able to control geometry previews? I’d love to be able to manipulate geometry in Rhino, with Grasshopper running in the background, changing the geometry’s display colour according to the volume of the brep, for example.

I just saw this topic pop up and I thought: “yeah! That’s a cool idea I could really use that!” Scrolling up I realized I had originally posted it :rofl:

What you a asking here is very different, but also very useful. A workaround to achieve what you are asking would be to give your active geometry custom object display more like wireframe. So you don’t have ‘double sharing’ between your active Rhino Object and your GH display. Then you give the GH reference whichever logic that drives the preview component.

3 Likes

You’ve come full circle.

1 Like

I just have all my Rhino layer system inside of one overall Rhino layer called “Rhino”. It is very easy to just turn the lightbulb off and on.

Probably better I make this request a separate thread so the powers that be might take notice, right?