Post #1867: This is not easy but possible. Try this code in Custom tab:
📋 Metadata
- Author: roaoao
- Date: 2019-01-20 19:12:21
- Type:
answer - Quality Score: 9/10
- Reply to: post_01866
- Replies (1): post_01869
🏷️ Tags
custom-tab transform-orientation advanced solved
⚙️ Related PME Features
- Custom Tab
- Command Tab
- Python Scripting
- Pie Menu Editor
💬 Content
This is not easy but possible. Try this code in Custom tab:
tool = C.workspace.tools.from_space_view3d_mode(C.mode); ori = dict(Global=0, Transform=1, Move=1, Rotate=2, Shear=2, Scale=3, Resize=3); L.column(align=True).prop(C.scene.transform_orientation_slots[ori.get(tool.name, 0)], "type", expand=True)
If you want to set some value (eg. ‘GLOBAL’) use this code in Command tab:
value = 'GLOBAL'; tool = C.workspace.tools.from_space_view3d_mode(C.mode); ori = dict(Global=0, Transform=1, Move=1, Rotate=2, Shear=2, Scale=3, Resize=3); C.scene.transform_orientation_slots[ori.get(tool.name, 0)].type = value