The Python API docs for TransformOrientationSlot say that these objects have a “type” attribute, which is supposed to be an enum in [‘GLOBAL’, ‘LOCAL’, ‘NORMAL’, ‘GIMBAL’, ‘VIEW’, ‘CURSOR’], default ‘GLOBAL’
.
This seems to be wrong, if I make a new blend file, go into edit mode on the default cube, select the top face and hit the + button to create a new transform orientation like so:
And then I go to the scripting tab and run the following, I’m seeing a “.type” value of “Face” for one of the TransformOrientationSlot’s, seen here:
PYTHON INTERACTIVE CONSOLE 3.10.2 (main, Jan 27 2022, 08:34:43) [MSC v.1928 64 bit (AMD64)]
Builtin Modules: bpy, bpy.data, bpy.ops, bpy.props, bpy.types, bpy.context, bpy.utils, bgl, blf, mathutils
Convenience Imports: from mathutils import *; from math import *
Convenience Variables: C = bpy.context, D = bpy.data
>>> [thing[1].type for thing in list(bpy.context.scene.transform_orientation_slots.items())]
['Face', 'DEFAULT', 'DEFAULT', 'DEFAULT']
Why am I seeing this value? The docs surrounding TransformOrientation, TransformOrientationSlot, and bpy.types.Scene.transform_orientation_slots are just really, really bad. Would be good to see an explanation of how these work, how they’re intended to be used, and to have docs that actually match the way they behave…
When I make a new orientation from a different face on the cube, I don’t see the new orientation listed in the orientation_slots either, there are still only 4 listed, and the “type” of the first one now has a different name:
>>> [thing[1].type for thing in list(bpy.context.scene.transform_orientation_slots.items())]
['Face.001', 'DEFAULT', 'DEFAULT', 'DEFAULT']
What is going on here?