I’m having an issue with a script I wrote where from certain angles, the script fails. This is the line of code that sometimes just returns NoneType:
view3d_utils.location_3d_to_region_2d(viewport, bpy.context.space_data.region_3d, selVerts[0].co).y
Does anybody know why this would sometimes return nothing? I’ve attached the script in its entirety in case that helps. The idea is that you can align a selection to the farthest left/right/up/down vertex in that selection, relative to the view. It’s kind of ugly, and has a crappy method of determining view angles, so apologies for the icky mess
pat_smartAlign.py (5.2 KB)