jayanam/jmesh-tools

Primitive mode/tool crashes when switching tabs

ChrisTriesToCode opened this issue · 4 comments

v1.2.8.1

Hi,

when you enable primitive mode and than switch to lets say animation etc. and back to another tab it will crash the tool
Restart or new file required to reset it.

bpy.ops.machin3.new()
bpy.ops.object.fc_primitve_mode_op()
Traceback (most recent call last):
File "C:\Users\ username \AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\jmesh-tools-master\fc_primitive_mode_op.py", line 190, in modal
mouse_pos_2d, mouse_pos_3d = self.get_snapped_mouse_pos(mouse_pos_2d_r, context)
File "C:\Users\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\jmesh-tools-master\fc_primitive_mode_op.py", line 103, in get_snapped_mouse_pos
mouse_pos_3d = self.get_3d_for_mouse(mouse_pos_2d, context)
File "C:\Users\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\jmesh-tools-master\fc_primitive_mode_op.py", line 115, in get_3d_for_mouse
mouse_pos_3d = self.shape.get_3d_for_2d(mouse_pos_2d, context)
File "C:\Users\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\jmesh-tools-master\types\shape.py", line 137, in get_3d_for_2d
origin, direction = get_origin_and_direction(pos_2d, context)
File "C:\Users\AppData\Roaming\Blender Foundation\Blender\2.82\scripts\addons\jmesh-tools-master\utils\fc_view_3d_utils.py", line 60, in get_origin_and_direction
region_3d = context.space_data.region_3d
AttributeError: 'NoneType' object has no attribute 'region_3d'

location: :-1

I have more errors for apply all/selected booleans but I need to find methods first the reproduce them on a reliable basis.

Fixed some stuff here but Blender seems to have issues here, events get invalid after workspace change for my operator - will come back to this issue

Fixed some stuff here but Blender seems to have issues here, events get invalid after workspace change for my operator - will come back to this issue

Thx for your fast replies and fixes :)
At least its not hard crashing anymore....and not sure if a normal workflow would encounter that

I close it for now, but will come back to similar issue when adding event listeners.