mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #154398: Unpacking an image via the N-panel in shader editor doesn't work
`image_from_context` returns null during poll check which prevents the exec() callback. Add `edit_image` condition inside `node_context()`, that way `image_from_context` returns valid image ID. Pull Request: https://projects.blender.org/blender/blender/pulls/154439
This commit is contained in:
parent
1dee3778af
commit
eb658361a4
1 changed files with 9 additions and 1 deletions
|
|
@ -1467,7 +1467,15 @@ static int /*eContextResult*/ node_context(const bContext *C,
|
|||
}
|
||||
return CTX_RESULT_OK;
|
||||
}
|
||||
|
||||
if (CTX_data_equals(member, "edit_image")) {
|
||||
if (bNode *node = bke::node_get_active(*snode->edittree)) {
|
||||
if (ELEM(node->type_legacy, SH_NODE_TEX_IMAGE, SH_NODE_TEX_ENVIRONMENT)) {
|
||||
Image *image = id_cast<Image *>(node->id);
|
||||
CTX_data_id_pointer_set(result, &image->id);
|
||||
return CTX_RESULT_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CTX_RESULT_MEMBER_NOT_FOUND;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue