UI: Add Open Image button to Mask Stencil Image panel
authorAaron Carlisle <carlisle.b3d@gmail.com>
Fri, 21 Jul 2017 20:46:35 +0000 (16:46 -0400)
committerAaron Carlisle <carlisle.b3d@gmail.com>
Fri, 21 Jul 2017 20:52:41 +0000 (16:52 -0400)
In the future we should make these two buttons on one line
However because we need `gen_context = 'PAINT_STENCIL'`
this is a little hard and we need to find a proper solution.
One might be using `context_pointer_set`

Patch by @craig_jones with edits by @blendify

Differential Revision: https://developer.blender.org/D2710

release/scripts/startup/bl_ui/space_view3d_toolbar.py

index 798c3aafe0b69a0a012231e3db27e226cd01e211..4026bc972fe375f9a9936242405d35a400b6887d 100644 (file)
@@ -1243,7 +1243,7 @@ class VIEW3D_PT_slots_projectpaint(View3DPanel, Panel):
             uv_text = mesh.uv_textures.active.name if mesh.uv_textures.active else ""
             col.label("Canvas Image:")
             # todo this should be combinded into a single row
-            col.template_ID(settings, "canvas", col.template_ID)
+            col.template_ID(settings, "canvas", open="image.open")
             col.operator("image.new", text="New").gen_context = 'PAINT_CANVAS'
             col.label("UV Map:")
             col.menu("VIEW3D_MT_tools_projectpaint_uvlayer", text=uv_text, translate=False)