Post #353: ![](https://blenderartists.org/user_avatar/blenderartists.org/rhyging5/48/725092

📋 Metadata

  • Author: roaoao
  • Date: 2016-09-26 01:57:19
  • Type: answer
  • Quality Score: 8/10
  • Reply to: post_00352

🏷️ Tags

popup-dialog python-scripting advanced solved

  • Popup Dialog Editor
  • Python Scripting
  • Property Editor

💬 Content

rhyging5:

can you tell me if possible to get the curve panel of cavity mask option in texture paint mode?

I tried with this line, but doesn’t works:

ip = toolsettings.image_paint(C); L.template_curve_mapping(ip, “cavity_curve”, brush=True) if ip else None

Try this code:

bl_context.set_context(C); ip = paint_settings(bl_context); L.template_curve_mapping(ip, "cavity_curve", brush=True) if ip else None 

paint_settings function returns context sensitive paint settings (texture paint settings in this case).
bl_context is a wrapper for bpy.context which fixes some blender issues in popup dialogs.


🔗 View on Blender Artists