Page MenuHome

Sculpt / Paint: show "Show Texture in texture tab" button
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on Dec 10 2020, 1:02 PM.

Details

Summary

This enables the quick access button [to show the relevant Texture in
the Properties Editor] whereever brush textures are shown:

  • header 'Texture' popup
  • Sidebar > Tool tab (Brush Settings > 'Texture' panel)
  • Properties Editor > Active Tool tab (Brush Settings > 'Texture' panel)


This goes in line to what we do for other textures:

  • modifier textures have this button
  • particle textures have this button
  • probably others as well

Following changes were needed:

  • call template_ID_preview for brush.texture_slot.texture (rather than

brush.texture), otherwise check in uiTemplateTextureShow /
template_texture_show does not match ButsContextTexture users

  • utility to find the Properties Editor in the screen

Diff Detail

Repository
rB Blender
Branch
brush_texture_properties_button (branched from master)
Build Status
Buildable 11825
Build 11825: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Dec 10 2020, 1:02 PM
Philipp Oeser (lichtwerk) created this revision.
This revision is now accepted and ready to land.Dec 16 2020, 7:48 PM
Hans Goudey (HooglyBoogly) requested changes to this revision.Dec 17 2020, 9:58 PM

I'm not sure this should just use the first property editor it finds. If is more than one open the choice feels random.

I realize this opens more questions, expanding the scope of this patch, but I think it's important, the area it changes can be the one on the opposite side of the screen when there are two open.

My suggestion is adding a BKE_screen_find_closest_area_xy function that could find the closest property editor. Maybe some others have issues with this sort of "smart" behavior, but it's better than nothing in my opinion.

source/blender/editors/space_buttons/buttons_texture.c
524–526

This should use the LISTBASE_FOREACH macro.

This revision now requires changes to proceed.Dec 17 2020, 9:58 PM

Also, I noticed that the button disappeared after I clicked it.

use LISTBASE_FOREACH

Philipp Oeser (lichtwerk) marked an inline comment as done.Dec 18 2020, 6:28 PM

Also, I noticed that the button disappeared after I clicked it.

This happens on purpose (this is existing behavior), see comment in uiTemplateTextureShow:

/* only show button in other tabs in properties editor */

So if it is already showing in the 'correct' tab, button will vanish.

Since most of this has already been implemented with D10293: Geometry Nodes: show "Show Texture in texture tab" button, and the button is now already showing for brush textures as well (but disabled), the only thing left to do is correct the texture user in the UI code (slot texture vs brush texture).
This will be its own task though.