D2608: Allow HDR picking from Compositor background

Replaced some STREQ(snode->tree_idname, ...) calls with ED_node_is_*() calls for improved readability, fixed one case where the STREQ was used the wrong way
This commit is contained in:
Stefan Werner
2017-04-20 22:32:00 +02:00
parent ca958642fa
commit b628f765b0
2 changed files with 7 additions and 7 deletions

View File

@@ -92,9 +92,9 @@ static int node_group_operator_editable(bContext *C)
* Disabled otherwise to allow pynodes define their own operators
* with same keymap.
*/
if (STREQ(snode->tree_idname, "ShaderNodeTree") ||
STREQ(snode->tree_idname, "CompositorNodeTree") ||
STREQ(snode->tree_idname, "TextureNodeTree"))
if (ED_node_is_shader(snode) ||
ED_node_is_compositor(snode) ||
ED_node_is_texture(snode))
{
return true;
}
@@ -112,11 +112,11 @@ static const char *group_node_idname(bContext *C)
{
SpaceNode *snode = CTX_wm_space_node(C);
if (STREQ(snode->tree_idname, "ShaderNodeTree"))
if (ED_node_is_shader(snode))
return "ShaderNodeGroup";
else if (STREQ(snode->tree_idname, "CompositorNodeTree"))
else if (ED_node_is_compositor(snode))
return "CompositorNodeGroup";
else if (STREQ(snode->tree_idname, "TextureNodeTree"))
else if (ED_node_is_texture(snode))
return "TextureNodeGroup";
return "";

View File

@@ -430,7 +430,7 @@ bool ED_space_node_color_sample(Scene *scene, SpaceNode *snode, ARegion *ar, int
float fx, fy, bufx, bufy;
bool ret = false;
if (STREQ(snode->tree_idname, ntreeType_Composite->idname) || (snode->flag & SNODE_BACKDRAW) == 0) {
if (!ED_node_is_compositor(snode) || (snode->flag & SNODE_BACKDRAW) == 0) {
/* use viewer image for color sampling only if we're in compositor tree
* with backdrop enabled
*/