mcneel / ghpython

A Grasshopper component for Rhino.Python
http://www.food4rhino.com/project/ghpython
117 stars 34 forks source link

Slider Undo causes input param to temporarily not exist #73

Closed AndersDeleuran closed 7 years ago

AndersDeleuran commented 7 years ago

Hi Giulio/Steve,

I recently noticed a small bug in the GHPython component (also present in the Rhino 6 WIP version): If you have a slider wired up to an input param, change the slider and then undo, this will cause the input param variable to temporarily not exist within the scope of the script (throwing an error if you're calling this variable). An obvious workaround (and good practice in general) is to check that the variable exists in the first place before calling it, but I'm thinking that this does seems like a bug and is not be design. It only seems to happens with sliders (i.e. panels, value lists etc seem to undo okay). The C# script editor does not appear to have similar issues with undoing.

Posted an example file in the mirror post over on the GHForum:

http://www.grasshopper3d.com/forum/topics/ghpython-slider-undo-causes-input-param-to-temporarily-not-exist

Cheers,

Anders

piac commented 7 years ago

Sorry, not a GhPython bug. Same error happens in C# component, but is masked by the conversion to double (null gets converted to 0 in that case)

piac commented 7 years ago

Please see the discussion for more in-depth information.