Post #2447: ![](https://blenderartists.org/user_avatar/blenderartists.org/colacuve/48/535989

๐Ÿ“‹ Metadata

๐Ÿท๏ธ Tags

pie-menu hotkeys advanced solved

  • Custom Python scripting
  • Mode toggling
  • Operator integration

๐Ÿ’ฌ Content

Colacuve:

I was wondering if it would be easy enough for this to include draw/object mode for when grease pencil is selected

You can use something like this (Custom tab):

ao = C.active_object; toggle_modes = dict(MESH=("OBJECT", "EDIT"), GPENCIL=("OBJECT", "PAINT_GPENCIL")); modes = ao and toggle_modes.get(ao.type, toggle_modes["MESH"]) or toggle_modes["MESH"]; mode = modes[0] if ao and ao.mode == modes[1] else modes[1]; ao and operator(L, "object.mode_set", text=L.enum_item_name(ao, "mode", ao.mode), icon_value=L.enum_item_icon(ao, "mode", ao.mode), mode=mode) or operator(L, "pme.message_box", text="None", message="None object")

Colacuve:

it would be great if items like greasepencil and lights were separate categories as wellโ€ฆ

Yes, Iโ€™ll try to add them in the next version.


โค๏ธ 1 likes


๐Ÿ”— View on Blender Artists