Post #2507: ” (from mira tools script)
i have error message: View3D not found, cannot run operator!. Is there any chance to run those kind of scripts from custom toolbar?
Yes, try to use override_context() function in this case:
bpy.ops.mira.curve_stretch(override_context('VIEW_3D'), 'INVOKE_DEFAULT', True)
Pinhead:
Is Macro Operatoris limited to 6 commands?
When i try in pie menu run this menu the last command not working.
You are using wm.context_toggle operator which for some reason can stop macro operators in some cases.
Try to use this code:
C.space_data.overlay.show_axis_y = not C.space_data.overlay.show_axis_y
instead of:
bpy.ops.wm.context_toggle(data_path='space_data.overlay.show_axis_y')
Or add 'EXEC_DEFAULT', True arguments:
bpy.ops.wm.context_toggle('EXEC_DEFAULT', True, data_path='space_data.overlay.show_axis_y')