diff options
Diffstat (limited to 'source/blender/editors/space_node')
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 59 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_edit.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_group.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 7 |
5 files changed, 53 insertions, 25 deletions
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 73f95870329..86f9bc5d768 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -885,6 +885,11 @@ static void node_shader_buts_uvmap(uiLayout *layout, bContext *C, PointerRNA *pt } } +static void node_shader_buts_uvalongstroke(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "use_tips", 0, NULL, 0); +} + static void node_shader_buts_normal_map(uiLayout *layout, bContext *C, PointerRNA *ptr) { uiItemR(layout, ptr, "space", 0, "", 0); @@ -937,30 +942,23 @@ static void node_shader_buts_anisotropic(uiLayout *layout, bContext *UNUSED(C), static void node_shader_buts_subsurface(uiLayout *layout, bContext *C, PointerRNA *ptr) { - /* SSS does not work on GPU yet */ + /* SSS only enabled in Experimental Kernel */ PointerRNA scene = CTX_data_pointer_get(C, "scene"); if (scene.data) { PointerRNA cscene = RNA_pointer_get(&scene, "cycles"); - if (cscene.data && (RNA_enum_get(&cscene, "device") == 1 && U.compute_device_type != 0)) - uiItemL(layout, IFACE_("SSS not supported on GPU"), ICON_ERROR); + if (cscene.data && + ((U.compute_device_type != USER_COMPUTE_DEVICE_NONE) && + (RNA_enum_get(&cscene, "device") == 1) && + (RNA_enum_get(&cscene, "feature_set") == 0))) + { + uiItemL(layout, IFACE_("Only enabled in experimental GPU kernel"), ICON_ERROR); + } } uiItemR(layout, ptr, "falloff", 0, "", ICON_NONE); } -static void node_shader_buts_volume(uiLayout *layout, bContext *C, PointerRNA *UNUSED(ptr)) -{ - /* Volume does not work on GPU yet */ - PointerRNA scene = CTX_data_pointer_get(C, "scene"); - if (scene.data) { - PointerRNA cscene = RNA_pointer_get(&scene, "cycles"); - - if (cscene.data && (RNA_enum_get(&cscene, "device") == 1 && U.compute_device_type != 0)) - uiItemL(layout, IFACE_("Volumes not supported on GPU"), ICON_ERROR); - } -} - static void node_shader_buts_toon(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { uiItemR(layout, ptr, "component", 0, "", ICON_NONE); @@ -1000,6 +998,16 @@ static void node_shader_buts_script_ex(uiLayout *layout, bContext *C, PointerRNA #endif } +static void node_buts_output_linestyle(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiLayout *row, *col; + + col = uiLayoutColumn(layout, false); + row = uiLayoutRow(col, true); + uiItemR(row, ptr, "blend_type", 0, "", ICON_NONE); + uiItemR(col, ptr, "use_clamp", 0, NULL, ICON_NONE); +} + /* only once called */ static void node_shader_set_butfunc(bNodeType *ntype) { @@ -1107,12 +1115,6 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_SUBSURFACE_SCATTERING: ntype->draw_buttons = node_shader_buts_subsurface; break; - case SH_NODE_VOLUME_SCATTER: - ntype->draw_buttons = node_shader_buts_volume; - break; - case SH_NODE_VOLUME_ABSORPTION: - ntype->draw_buttons = node_shader_buts_volume; - break; case SH_NODE_BSDF_TOON: ntype->draw_buttons = node_shader_buts_toon; break; @@ -1126,6 +1128,12 @@ static void node_shader_set_butfunc(bNodeType *ntype) case SH_NODE_UVMAP: ntype->draw_buttons = node_shader_buts_uvmap; break; + case SH_NODE_UVALONGSTROKE: + ntype->draw_buttons = node_shader_buts_uvalongstroke; + break; + case SH_NODE_OUTPUT_LINESTYLE: + ntype->draw_buttons = node_buts_output_linestyle; + break; } } @@ -2307,6 +2315,12 @@ static void node_composit_buts_cornerpin(uiLayout *UNUSED(layout), bContext *UNU { } +static void node_composit_buts_sunbeams(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) +{ + uiItemR(layout, ptr, "source", UI_ITEM_R_EXPAND, "", ICON_NONE); + uiItemR(layout, ptr, "ray_length", UI_ITEM_R_SLIDER, NULL, ICON_NONE); +} + /* only once called */ static void node_composit_set_butfunc(bNodeType *ntype) { @@ -2531,6 +2545,9 @@ static void node_composit_set_butfunc(bNodeType *ntype) case CMP_NODE_CORNERPIN: ntype->draw_buttons = node_composit_buts_cornerpin; break; + case CMP_NODE_SUNBEAMS: + ntype->draw_buttons = node_composit_buts_sunbeams; + break; } } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 2dea441c03d..52c1cefbfed 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -138,6 +138,10 @@ void ED_node_tag_update_id(ID *id) DAG_id_tag_update(id, 0); WM_main_add_notifier(NC_TEXTURE | ND_NODES, id); } + else if (id == &ntree->id) { + /* node groups */ + DAG_id_tag_update(id, 0); + } } void ED_node_tag_update_nodetree(Main *bmain, bNodeTree *ntree) diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 1c41ce9d86d..ca13d87d632 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -640,11 +640,11 @@ void ED_node_set_active(Main *bmain, bNodeTree *ntree, bNode *node) /* tree specific activate calls */ if (ntree->type == NTREE_SHADER) { /* when we select a material, active texture is cleared, for buttons */ - if (node->id && ELEM3(GS(node->id->name), ID_MA, ID_LA, ID_WO)) + if (node->id && ELEM(GS(node->id->name), ID_MA, ID_LA, ID_WO)) nodeClearActiveID(ntree, ID_TE); - if (ELEM4(node->type, SH_NODE_OUTPUT, SH_NODE_OUTPUT_MATERIAL, - SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LAMP)) + if (ELEM(node->type, SH_NODE_OUTPUT, SH_NODE_OUTPUT_MATERIAL, + SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LAMP, SH_NODE_OUTPUT_LINESTYLE)) { bNode *tnode; diff --git a/source/blender/editors/space_node/node_group.c b/source/blender/editors/space_node/node_group.c index 39aba921f72..96cc7fb4407 100644 --- a/source/blender/editors/space_node/node_group.c +++ b/source/blender/editors/space_node/node_group.c @@ -200,7 +200,7 @@ static int node_group_ungroup(bNodeTree *ntree, bNode *gnode) * - ngroup (i.e. the source NodeTree) is left unscathed * - temp copy. don't change ID usercount */ - wgroup = ntreeCopyTree_ex(ngroup, false); + wgroup = ntreeCopyTree_ex(ngroup, G.main, false); /* Add the nodes into the ntree */ for (node = wgroup->nodes.first; node; node = nextnode) { diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index ddfbe3bebf2..9eaee60bfce 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -501,6 +501,12 @@ static void node_area_listener(bScreen *sc, ScrArea *sa, wmNotifier *wmn) } } break; + + case NC_LINESTYLE: + if (ED_node_is_shader(snode) && shader_type == SNODE_SHADER_LINESTYLE) { + ED_area_tag_refresh(sa); + } + break; } } @@ -740,6 +746,7 @@ static void node_region_listener(bScreen *UNUSED(sc), ScrArea *UNUSED(sa), ARegi case NC_TEXTURE: case NC_WORLD: case NC_NODE: + case NC_LINESTYLE: ED_region_tag_redraw(ar); break; case NC_OBJECT: |