blenderbezierutils
blenderbezierutils copied to clipboard
Error after pressing CTRL
I got an error after pressing the CTRL hotkey while creating some curves.
Original bug report : https://blenderartists.org/t/flexi-bezier-tool/1168179/377
Addon version : 0.9.85 Blender version : blender-2.83-9d90cad3ed39-windows64 & blender-2.83-11df5443e5d0-windows64
Traceback (most recent call last):
File “C:\Users\Sebastien\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbezierutils.py”, line 4432, in modal
return self.subModal(context, event, evtCons)
File “C:\Users\Sebastien\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbezierutils.py”, line 5253, in subModal
return self.baseSubModal(context, event, snapProc)
File “C:\Users\Sebastien\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbezierutils.py”, line 5140, in baseSubModal
return self.drawObj.procDrawEvent(context, event, snapProc)
File “C:\Users\Sebastien\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbezierutils.py”, line 4999, in procDrawEvent
loc = snapper.get3dLocSnap(rmInfo)
File “C:\Users\Sebastien\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbezierutils.py”, line 3985, in get3dLocSnap
rounding = getViewDistRounding(rmInfo.space3d, rv3d)
File “C:\Users\Sebastien\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\blenderbezierutils.py”, line 520, in getViewDistRounding
return int(log(viewDist, getGridSubdiv(space3d))) - 1
ZeroDivisionError: float division by zero
location: :-1
This issue was caused because the condition 'Grid Subdivision' (in 'Viewport Overlays' ) = 1 was not handled in script. There can be a proper fix to the problem after it's known how Blender makes use of the value of grid subdivision option (currently the option is disabled in Blender versions later than 2.8).
For now, I have put a work-around to avoid the exception.