Problem : Z location of camera keeps changing when zooming?

Hi, lately I been scripting some components in GhPython, using ghenv.Component.Params…, and also trying to get the viewport corner points. So when the value of the ExpireSolution() is True, the Z location, and Z target values of the viewport camera keeps changing when zooming with the mouse, and at some point the camera gets lost and the only way to fix the problem is by turning off Rhino.It may be a problem of compatibility with other plugins, it seem to fail with large grasshopper definitions with Kangaroo, and timers.
I know that it is somehow relate it to the ExpireSolution(), because when it is change to False the problem seem to be solve, except that when the slider is update, the Z values change again with it, but not by zooming with the mouse. I was wondering if someone else has had the same problem, and for what ExpireSolution() is use?, and if there’s any solution to the problem?. Thanks


Python Sliders Problem.gh (3.8 KB)

ExpireSolution() is hardly going to play well with timers and other objects that, on their own, expire the document.

You might want to think of another way to expire the solution, maybe making your GhPython script dependent from the timer itself (and without other “ExpireSolutions”).

Giulio


Giulio Piacentino
for Robert McNeel & Associates
giulio@mcneel.com

I’ve had exactly the same issue crop up with relatively small Kangaroo 2 definitions when the inputs cause the solver to diverge. However I assumed it’s because the resulting geometry exploded away to infinity and the rhino viewport doesn’t know how to deal with it, and not anything related to ExpireSolution.

Stopping/restarting the solver didn’t cause the camera issue to go away though, and it seemed to happen on a random basis- i.e. not the case for all diverging inputs, maybe 1 in 20 chance.

1 Like

Hi, I was able to solve the problem by removing a component from the Human(Andrew Heumann) plugin call TextToScreen, but I still don’t get why it happens it may be because that component use windows.forms and somehow is constantly refreshing, it would be nice to have a list of when this problem occurs it seem to be a very difficult problem to diagnose.
Hi, Giulio, yes I tried by using the OnPingDocument() method instead of the ExpireSolution() and it didn’t fix it. Thanks
I don’t believe this problem necessarily relates to the Geometry Exploding “thing”, because it doesn’t depend on Kangaroo for it to happens, secondly it happens suddenly when the Z Values reach to is it’s maximum value possible and Third: as the Z value goes on changing, no geometry changes can be seen in the viewport. What you can see it’s some kind of strange jittering in the screen as values increases but the geometry stay the same till it completely disappears.Thanks