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:
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