UI: expose gizmo orientation as a single enum
Avoids awkward logic from the popover, by faking an extra item in the enum.
This commit is contained in:
@@ -69,23 +69,7 @@ class _template_widget:
|
||||
def draw_settings_with_index(context, layout, index):
|
||||
scene = context.scene
|
||||
orient_slot = scene.transform_orientation_slots[index]
|
||||
use_global = orient_slot.use_global
|
||||
row = layout.row(align=True)
|
||||
|
||||
row.label(text="Orientation:")
|
||||
|
||||
popover_kw = {
|
||||
"panel": "VIEW3D_PT_transform_orientations_gizmo_" f"{index}",
|
||||
}
|
||||
|
||||
if use_global:
|
||||
popover_kw["text"], popover_kw["icon"] = "Scene", 'OBJECT_ORIGIN'
|
||||
else:
|
||||
popover_kw["text"], popover_kw["icon_value"] = orient_slot.ui_info()
|
||||
|
||||
sub = layout.row()
|
||||
sub.ui_units_x = 4
|
||||
sub.popover(**popover_kw)
|
||||
layout.prop(orient_slot, "type")
|
||||
|
||||
|
||||
class _defs_view3d_generic:
|
||||
|
Reference in New Issue
Block a user