From baaa89a0bc54a659f9ddbc34cce21d6920c0f6a6 Mon Sep 17 00:00:00 2001 From: OmarSquircleArt Date: Wed, 4 Sep 2019 23:17:13 +0200 Subject: Shading: Rewrite Mapping node with dynamic inputs. This patch rewrites the Mapping node to support dynamic inputs. The Max and Min options have been removed. They can be added as Min and Max Vector Math nodes manually. Texture nodes still use the old matrix-based mapping. A new SVM node `NODE_TEXTURE_MAPPING` has been added to preserve this functionality. Similarly, in GLSL, a `mapping_mat4` function has been added. Reviewers: brecht, JacquesLucke --- source/blender/editors/space_node/drawnode.c | 32 +--------------------------- 1 file changed, 1 insertion(+), 31 deletions(-) (limited to 'source/blender/editors/space_node') diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 47433693e7b..8e6b09be2c7 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -731,37 +731,7 @@ static void node_buts_image_user(uiLayout *layout, static void node_shader_buts_mapping(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) { - uiLayout *row, *col, *sub; - - uiItemR(layout, ptr, "vector_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE); - - row = uiLayoutRow(layout, false); - - col = uiLayoutColumn(row, true); - uiItemL(col, IFACE_("Location:"), ICON_NONE); - uiItemR(col, ptr, "translation", 0, "", ICON_NONE); - - col = uiLayoutColumn(row, true); - uiItemL(col, IFACE_("Rotation:"), ICON_NONE); - uiItemR(col, ptr, "rotation", 0, "", ICON_NONE); - - col = uiLayoutColumn(row, true); - uiItemL(col, IFACE_("Scale:"), ICON_NONE); - uiItemR(col, ptr, "scale", 0, "", ICON_NONE); - - row = uiLayoutRow(layout, false); - - col = uiLayoutColumn(row, true); - uiItemR(col, ptr, "use_min", 0, IFACE_("Min"), ICON_NONE); - sub = uiLayoutColumn(col, true); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_min")); - uiItemR(sub, ptr, "min", 0, "", ICON_NONE); - - col = uiLayoutColumn(row, true); - uiItemR(col, ptr, "use_max", 0, IFACE_("Max"), ICON_NONE); - sub = uiLayoutColumn(col, true); - uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_max")); - uiItemR(sub, ptr, "max", 0, "", ICON_NONE); + uiItemR(layout, ptr, "vector_type", 0, NULL, ICON_NONE); } static void node_shader_buts_vect_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr) -- cgit v1.2.3