Post #346: ![](https://blenderartists.org/user_avatar/blenderartists.org/aermartin/48/8843_

๐Ÿ“‹ Metadata

๐Ÿท๏ธ Tags

scripting advanced solved

  • Pie Menu Editor
  • Custom tab
  • Python Scripting
  • Color picker integration

๐Ÿ’ฌ Content

aermartin:

http://pasteall.org/81141/javascript
here you go, save it as .json

Thanks.
Itโ€™s blenderโ€™s issue. PME has fix for it. But looks like I forgot to apply it in Examples menu (Custom tab).
You need to replace all C (or bpy.context) variables with bl_context variable in all color related buttons (Color, Sample and Palette). And add this code: bl_context.set_context(C);

For example in Color button (Custom tab):

Replace

ps = paint_settings(C); T.VIEW3D_PT_tools_brush.prop_unified_color_picker(L, C, ps.brush, 'color') if ps and ps.brush else None

With

bl_context.set_context(C); ps = paint_settings(bl_context); T.VIEW3D_PT_tools_brush.prop_unified_color_picker(L, bl_context, ps.brush, 'color') if ps and ps.brush else None

๐Ÿ”— View on Blender Artists