[BUG] broken hosted RhinoViewports following GH for RH8 update

Dear McNeel team,

It looks like in a recent update of Grasshopper for RH8 has introduced a test too strict in GH_Document.ShouldDrawPreview(e) (or so I guessed) that prevents Grasshopper to refresh viewports hosted in WPF by RhinoInside applications. This is a big issue for us as it means we cannot have Grasshopper to redraw anything in our RhinoInside-based software anymore.

The problem is a recurring one, I already mentioned it in this post more than a year ago, which unfortunately was left unanswered:

  • Rhino viewports that have no parent Rhino View are discarded from some redrawing and picking (getpoint) interactions.
  • There is no way to add a parent View in the ViewTable for a hosted WPF viewport, thus creating all sorts of refresh and event passing problems that so far I managed to fix by recoding all viewport interactions including picking, gumballs,… but this time there is nothing I can do.

Could you please amend these changes and/or propose a solution to this issue, as it is not one I can bypass?

If I believe the debugger, this should be the culprit, but I cannot be sure:

private bool ShouldDrawPreview(DrawEventArgs e) => object.Equals((object) e.RhinoDoc, (object) this.RhinoDocument) && (e.Viewport != null && ((e.Viewport.ViewportType == ViewportType.StandardModelingViewport || e.Viewport.ViewportType == ViewportType.DetailViewport) && (**e.Viewport.ParentView != null** && this.ShouldDrawPreview())));

Best regards,
Thibault

@stevebaer - is this something you can help with?

Hi @stevebaer,
Apologies if I insist, but if you could let me know your thoughts about this, as our software (in production) is currently broken and we are looking for a solution in order to re-enable display.
Thanks,
Thibault

Hi Thibault,
I need to find the commit which broke your workflow. I’ll contact you in a PM to work out how to best figure this out.

1 Like

Thanks Thibault for helping us figure out when the regression happened. I created a bug for this at
https://mcneel.myjetbrains.com/youtrack/issue/RH-85828/ShouldDrawPreview-Changes-Breaks-Rhino.Inside-Application

1 Like

RH-85828 is fixed in Rhino 8 Service Release 16 Release Candidate