📋 Metadata

💬 Content

anminmakura:

How can I reproduce the view3d.view_axis specification like an image with Pie Menu Editor?

Add a new Stack Key with Click Drag hotkey and this code in Command tab:

is_vertical = abs(drag_y) > abs(drag_x); is_south = is_vertical and drag_y <= 0; is_north = is_vertical and drag_y > 0; is_west = not is_vertical and drag_x < 0; is_east = not is_vertical and drag_x > 0;  bpy.ops.view3d.view_axis('INVOKE_DEFAULT', True, relative=True, type=['LEFT', 'RIGHT', 'BOTTOM', 'TOP'][0 * is_west + 1 * is_east + 2 * is_south + 3 * is_north])

anminmakura:

I tried to get the property from AddonPreferences of other add-ons as shown in the second image and assign it to a shortcut such as Pie, but I could not call it well.

Find add-on’s id in Python Console using this code:

C.preferences.addons.keys()

And use it to get access to add-ons preferences:

C.preferences.addons['ADDON_ID'].preferences.groupBBox_use

or:

L.prop(C.preferences.addons['ADDON_ID'].preferences, 'groupBBox_use', text=slot, icon=icon, icon_value=icon_value)

❤️ 4 likes


🔗 View on Blender Artists