Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Oeser <info@graphics-engineer.com>2019-10-04 15:58:40 +0300
committerPhilipp Oeser <info@graphics-engineer.com>2019-10-04 16:31:54 +0300
commit40492251f2ff7b82468d8b922d95c2af4b98264c (patch)
tree112362143fcccf803c21fa4e42b3c6d74ee84645 /source/blender/editors/space_node
parentd590db83705b9bfbb663c9aa388f5bf6fff09116 (diff)
Fix T70454: Environment Texture Node Properties "reload" and "packing" not working
The bug was basically just caused by a missing 'edit_image' and 'edit_image_user' pointer in context for 'node_shader_buts_tex_environment_ex'. So adding the following there would be enough to fix the bug: uiLayoutSetContextPointer(layout, "edit_image", &imaptr); uiLayoutSetContextPointer(layout, "edit_image_user", &iuserptr); However, I would suggest using the full-flegged uiTemplateImage (just as 'node_shader_buts_tex_image_ex' does -- instead of a "handmade" subset) for the following consistency reasons: - Layout was using single column for image textures, but not environment textures - Save / Discard feature on editing the image was there for image textures, but not environment textures - Environment textures: Color Space was displayed on node (but not properties) - Environment textures: Animation / Sequence settings were displayed on node (but not properties) Cant think of a reason for _not_ displaying the whole set for environment textures (just as for regular image textures)? Maniphest Tasks: T70454 Differential Revision: https://developer.blender.org/D5988
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r--source/blender/editors/space_node/drawnode.c45
1 files changed, 1 insertions, 44 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index f7c772ef145..c0eedfeea1d 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -816,51 +816,8 @@ static void node_shader_buts_tex_environment(uiLayout *layout, bContext *C, Poin
static void node_shader_buts_tex_environment_ex(uiLayout *layout, bContext *C, PointerRNA *ptr)
{
- PointerRNA imaptr = RNA_pointer_get(ptr, "image");
PointerRNA iuserptr = RNA_pointer_get(ptr, "image_user");
- Image *ima = imaptr.data;
-
- uiLayoutSetContextPointer(layout, "image_user", &iuserptr);
- uiTemplateID(layout,
- C,
- ptr,
- "image",
- "IMAGE_OT_new",
- "IMAGE_OT_open",
- NULL,
- UI_TEMPLATE_ID_FILTER_ALL,
- false);
-
- if (!ima) {
- return;
- }
-
- uiItemR(layout, &imaptr, "source", 0, IFACE_("Source"), ICON_NONE);
-
- if (!(ELEM(ima->source, IMA_SRC_GENERATED, IMA_SRC_VIEWER))) {
- uiLayout *row = uiLayoutRow(layout, true);
- const bool is_packed = BKE_image_has_packedfile(ima);
-
- if (is_packed) {
- uiItemO(row, "", ICON_PACKAGE, "image.unpack");
- }
- else {
- uiItemO(row, "", ICON_UGLYPACKAGE, "image.pack");
- }
-
- row = uiLayoutRow(row, true);
- uiLayoutSetEnabled(row, !is_packed);
- uiItemR(row, &imaptr, "filepath", 0, "", ICON_NONE);
- uiItemO(row, "", ICON_FILE_REFRESH, "image.reload");
- }
-
- /* multilayer? */
- if (ima->type == IMA_TYPE_MULTILAYER && ima->rr) {
- uiTemplateImageLayers(layout, C, ima, iuserptr.data);
- }
- else if (ima->source != IMA_SRC_GENERATED) {
- uiTemplateImageInfo(layout, C, ima, iuserptr.data);
- }
+ uiTemplateImage(layout, C, ptr, "image", &iuserptr, 0, 0);
uiItemR(layout, ptr, "interpolation", 0, IFACE_("Interpolation"), ICON_NONE);
uiItemR(layout, ptr, "projection", 0, IFACE_("Projection"), ICON_NONE);