While rigging last night, I wrote this little script that forces the Local Rotation Axis display On/Off. This is different from Display–>Transform Display–>Local Rotation Axis because that works as a toggle, while this accesses the actual attribute (“obj.displayLocalAxis”) and sets it to True or False.
Here’s the code. It’s a really simple tool that fixes a big annoyance for me in Maya.
import maya.cmds as cmds # bm_axisDisplay # Forces the Local Rotation Axis display on or off for all joints or for the selected joints def setAxisDisplay(display=False): # if no joints are selected, do it for all the joints in the scene if len(cmds.ls(sl=1, type="joint")) == 0: jointList = cmds.ls(type="joint") else: jointList = cmds.ls(sl=1, type="joint") # set the displayLocalAxis attribute to what the user specifies. for jnt in jointList: cmds.setAttr(jnt + ".displayLocalAxis", display) """ import bm_axisDisplay reload(bm_axisDisplay) bm_axisDisplay.setAxisDisplay(False) """