[Bf-blender-cvs] [faac263d977] geometry-nodes-attribute-nodes: Merge branch 'geometry-nodes' into geometry-nodes-attribute-nodes
Hans Goudey
noreply at git.blender.org
Sun Nov 1 05:57:27 CET 2020
Commit: faac263d977fd976d194993307f1dd5bf8110c03
Author: Hans Goudey
Date: Sat Oct 31 23:01:31 2020 -0500
Branches: geometry-nodes-attribute-nodes
https://developer.blender.org/rBfaac263d977fd976d194993307f1dd5bf8110c03
Merge branch 'geometry-nodes' into geometry-nodes-attribute-nodes
===================================================================
===================================================================
diff --cc release/scripts/startup/nodeitems_builtins.py
index 743489c2358,4d53ca8a228..f3fbca47977
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@@ -490,12 -490,8 +490,13 @@@ geometry_node_categories =
NodeItem("GeometryNodeEdgeSplit"),
NodeItem("GeometryNodeTransform"),
NodeItem("GeometryNodeBoolean"),
+ NodeItem("GeometryNodeSubdivisionSurface"),
]),
+ GeometryNodeCategory("GEO_ATTRIBUTES", "Attributes", items=[
+ NodeItem("GeometryNodeCreateAttribute"),
+ NodeItem("GeometryNodeRandomAttribute"),
+ NodeItem("GeometryNodeAttributeMath"),
+ ]),
GeometryNodeCategory("GEO_SCATTERING", "Scattering", items=[
NodeItem("GeometryNodePointDistribute"),
NodeItem("GeometryNodePointInstance"),
diff --cc source/blender/blenkernel/BKE_node.h
index 85ca6c37268,839047036ce..f61d3037ee3
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -1346,9 -1346,7 +1346,10 @@@ int ntreeTexExecTree(struct bNodeTree *
#define GEO_NODE_BOOLEAN 1003
#define GEO_NODE_POINT_DISTRIBUTE 1004
#define GEO_NODE_POINT_INSTANCE 1005
- #define GEO_NODE_ATTRIBUTE_RANDOM 1006
- #define GEO_NODE_ATTRIBUTE_MATH 1007
- #define GEO_NODE_ATTRIBUTE_CREATE 1008
+ #define GEO_NODE_SUBDIVISION_SURFACE 1006
++#define GEO_NODE_ATTRIBUTE_RANDOM 1007
++#define GEO_NODE_ATTRIBUTE_MATH 1008
++#define GEO_NODE_ATTRIBUTE_CREATE 1009
/** \} */
diff --cc source/blender/editors/space_node/drawnode.c
index dbdbb9f78a3,51486e398c2..18e1d173fdd
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@@ -3140,38 -3140,31 +3140,52 @@@ static void node_texture_set_butfunc(bN
/* ****************** BUTTON CALLBACKS FOR GEOMETRY NODES ***************** */
- static void node_geometry_buts_boolean_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
- {
- uiItemR(layout, ptr, "operation", DEFAULT_FLAGS, "", ICON_NONE);
- }
-
+static void node_geometry_buts_attribute_create(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *ptr)
+{
+ uiItemR(layout, ptr, "data_type", DEFAULT_FLAGS, "", ICON_NONE);
+ uiItemR(layout, ptr, "domain", DEFAULT_FLAGS, "", ICON_NONE);
+}
+
+static void node_geometry_buts_attribute_math(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *ptr)
+{
+ uiItemR(layout, ptr, "operation", DEFAULT_FLAGS, "", ICON_NONE);
+}
+
+ static void node_geometry_buts_boolean_math(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
+ {
+ uiItemR(layout, ptr, "operation", DEFAULT_FLAGS, "", ICON_NONE);
+ }
+
+ static void node_geometry_buts_subdivision_surface(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *UNUSED(ptr))
+ {
+ #ifndef WITH_OPENSUBDIV
+ uiItemL(layout, IFACE_("Disabled, built without OpenSubdiv"), ICON_ERROR);
+ #else
+ UNUSED_VARS(layout);
+ #endif
+ }
+
static void node_geometry_set_butfunc(bNodeType *ntype)
{
switch (ntype->type) {
- case GEO_NODE_BOOLEAN:
- ntype->draw_buttons = node_geometry_buts_boolean_math;
- break;
+ case GEO_NODE_ATTRIBUTE_CREATE:
+ ntype->draw_buttons = node_geometry_buts_attribute_create;
+ break;
+ case GEO_NODE_ATTRIBUTE_MATH:
+ ntype->draw_buttons = node_geometry_buts_attribute_math;
+ break;
+ case GEO_NODE_BOOLEAN:
+ ntype->draw_buttons = node_geometry_buts_boolean_math;
+ break;
+ case GEO_NODE_SUBDIVISION_SURFACE:
+ ntype->draw_buttons = node_geometry_buts_subdivision_surface;
+ break;
}
}
More information about the Bf-blender-cvs
mailing list