diff options
author | Jesse Yurkovich <jesse.y@gmail.com> | 2022-06-01 06:57:33 +0300 |
---|---|---|
committer | Jesse Yurkovich <jesse.y@gmail.com> | 2022-06-01 06:57:33 +0300 |
commit | 12642bdeabeb35802ee196868c9dbd23c153f622 (patch) | |
tree | 29f799acff15c51a597846c651ab1c9afd4416ed /source/blender/editors/space_image/image_buttons.c | |
parent | 6cee4049143abf692af6ffb78c109fb0760fe67d (diff) |
Fix T96984: Create new image.browse operator for uiTemplateImage layouts
The existing BUTTONS_OT_file_browse operator that's used for
uiTemplateImage layouts fails to work correctly with UDIM textures.
This is mainly due to it not realizing that it must tokenize the
filepath before signaling that an update has been made. It also doesn't
work correctly when executing its SHIFT-click behavior to open the image
in an external application. Lastly, it doesn't set the filters to Images
and Movies which is suboptimal for the user.
The new operator takes the unique features of BUTTONS_OT_file_browse
and creates a customized variant better suited for images.
Differential Revision: https://developer.blender.org/D14824
Diffstat (limited to 'source/blender/editors/space_image/image_buttons.c')
-rw-r--r-- | source/blender/editors/space_image/image_buttons.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index 208928afc1f..d0c21f85472 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -845,7 +845,10 @@ void uiTemplateImage(uiLayout *layout, row = uiLayoutRow(row, true); uiLayoutSetEnabled(row, is_packed == false); - uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE); + + prop = RNA_struct_find_property(&imaptr, "filepath"); + uiDefAutoButR(block, &imaptr, prop, -1, "", ICON_NONE, 0, 0, 200, UI_UNIT_Y); + uiItemO(row, "", ICON_FILEBROWSER, "image.file_browse"); uiItemO(row, "", ICON_FILE_REFRESH, "image.reload"); } |