Post #2481: ![](https://blenderartists.org/user_avatar/blenderartists.org/raphaelbarros/48/1

📋 Metadata

🏷️ Tags

python-scripting intermediate solved

  • Python Scripting
  • override_context() function
  • UILayout customization

💬 Content

RaphaelBarros:

Is there any documentation or way I should go about find which custom code I should use?

RaphaelBarros:

I’ve got a lot of individual parts I need to expose and I’d rather not flood this thread with my questions, hahaha.

Imo “Edit Source” is the best documentation and a way to learn how to draw custom layouts.
And of course this page.

RaphaelBarros:

While I’m at it, do you know if there’s any way for me to save an texture image I baked from the 3D View? I tried to following code but it didn’t work (probably due to the context).

PME has override_context() function which tries to find and use required area in the current screen/workspace. Try this code:

bpy.ops.image.save_as(override_context('IMAGE_EDITOR'), save_as_render=False, filepath="//texture.png", relative_path=True, show_multiview=False, use_multiview=False)

❤️ 1 likes


🔗 View on Blender Artists