Oh dear, senior moment I think. What you youngsters have to bear in mind is that when you get to my age this will happen to you also.
I think I may have a solution to this:
Pivot Width set to 1.
Pivot Width set to 5.
Code (you will probably tell me this is crap and also how to improve it):
shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR') if not bpy.app.background else None
def draw_3d(coords, type, rgba, context):
scene = context.scene
batch = batch_for_shader(shader, type, {"pos": coords})
try:
if coords is not None:
#bgl.glEnable(bgl.GL_LINE_SMOOTH)
bgl.glEnable(bgl.GL_BLEND)
shader.bind()
shader.uniform_float("color", rgba)
batch.draw(shader)
except:
pass
def draw_callback_3d(self, context):
scene = context.scene
x = scene.pdt_pivotloc.x
y = scene.pdt_pivotloc.y
z = scene.pdt_pivotloc.z
a = scene.pdt_pivotsize
b = scene.pdt_pivotsize * 0.65
c = scene.pdt_pivotsize * 0.05 + (scene.pdt_pivotwidth * 0.01)
o = c / 3
# X Axis
coords = [(x,y,z), (x+b,y-o,z), (x+b,y+o,z), (x+a,y,z), (x+b,y+c,z), (x+b,y-c,z)]
colour = (1.0, 0.0, 0.0, 0.8)
draw_3d(coords, 'TRIS', colour, context)
# Y Axis
coords = [(x,y,z), (x-o,y+b,z), (x+o,y+b,z), (x,y+a,z), (x+c,y+b,z), (x-c,y+b,z)]
colour = (0.0, 1.0, 0.0, 0.8)
draw_3d(coords, 'TRIS', colour, context)
# Z Axis
coords = [(x,y,z), (x-o,y,z+b), (x+o,y,z+b), (x,y,z+a), (x+c,y,z+b), (x-c,y,z+b)]
colour = (0.2, 0.5, 1.0, 0.8)
draw_3d(coords, 'TRIS', colour, context)
# Centre
coords = [(x,y,z)]
colour = (0.2, 0.5, 1.0, 0.8)
draw_3d(coords, 'POINTS', colour, context)
I need to go and lie down in a darkened room in order to regain some mental capacity…
Cheers, Clock.