I have used this amazing script for ~5 years. It basically toggles on xray mode everytime I go to lasso select something. When I upgraded to 3.2 it broke. I’m not sure what broke as the code looks clean to me. There’s a piece of the code below.
I’ve read that they changed ‘MOUSEMOVE’ to have an event value of ‘NOTHING’ instead of ‘PRESS/RELEASE’
And I know that those things are used in the script, but I’m still not sure what to change as I’m pretty green at this.
Does anyone know how to help?
class HP_OT_select_through_lasso(bpy.types.Operator):
bl_idname = "view3d.select_through_lasso"
bl_label = "Select Through Lasso"
def modal(self, context, event):
bpy.context.space_data.shading.show_xray = True
if event.type == 'MOUSEMOVE' and event.value == 'PRESS':
bpy.ops.view3d.select_lasso('INVOKE_DEFAULT',mode='SET')
return {'RUNNING_MODAL'}
if event.type in {'RIGHTMOUSE', 'ESC'}: # Cancel
bpy.context.space_data.shading.show_xray = False
return {'CANCELLED'}
elif event.type == 'MOUSEMOVE' and event.value == 'RELEASE':
bpy.context.space_data.shading.show_xray = False
return {'CANCELLED'}
return {'RUNNING_MODAL'}
def invoke(self, context, event):
if bpy.context.space_data.shading.show_xray == True:
bpy.ops.view3d.select_lasso('INVOKE_DEFAULT',mode='SET')
else:
context.window_manager.modal_handler_add(self)
return {'RUNNING_MODAL'}