[Bf-blender-cvs] [f4590033bf3] temp-geometry-nodes-distribute-points-cleanup: Merge remote-tracking branch 'origin/master' into temp-geometry-nodes-distribute-points-cleanup
Dalai Felinto
noreply at git.blender.org
Fri Dec 11 22:19:22 CET 2020
Commit: f4590033bf3083fad7b4447bd1f4b1d0979296ab
Author: Dalai Felinto
Date: Fri Dec 11 21:53:33 2020 +0100
Branches: temp-geometry-nodes-distribute-points-cleanup
https://developer.blender.org/rBf4590033bf3083fad7b4447bd1f4b1d0979296ab
Merge remote-tracking branch 'origin/master' into temp-geometry-nodes-distribute-points-cleanup
===================================================================
===================================================================
diff --cc source/blender/editors/space_node/drawnode.c
index ad535f1bb2c,f8c71791054..75e6117f06d
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@@ -3182,13 -3182,32 +3182,39 @@@ static void node_geometry_buts_attribut
uiItemR(layout, ptr, "input_type_b", DEFAULT_FLAGS, IFACE_("Type B"), ICON_NONE);
}
+ static void node_geometry_buts_point_instance(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *ptr)
+ {
+ uiItemR(layout, ptr, "instance_type", DEFAULT_FLAGS | UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+ }
+
+ static void node_geometry_buts_attribute_fill(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_mix(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *ptr)
+ {
+ uiItemR(layout, ptr, "blend_type", DEFAULT_FLAGS, "", ICON_NONE);
+ uiLayout *col = uiLayoutColumn(layout, false);
+ uiItemR(col, ptr, "input_type_factor", DEFAULT_FLAGS, IFACE_("Factor"), ICON_NONE);
+ uiItemR(col, ptr, "input_type_a", DEFAULT_FLAGS, IFACE_("A"), ICON_NONE);
+ uiItemR(col, ptr, "input_type_b", DEFAULT_FLAGS, IFACE_("B"), ICON_NONE);
+ }
+
+static void node_geometry_buts_attribute_point_distribute(uiLayout *layout,
+ bContext *UNUSED(C),
+ PointerRNA *ptr)
+{
+ uiItemR(layout, ptr, "distribute_method", DEFAULT_FLAGS, "", ICON_NONE);
+}
+
static void node_geometry_set_butfunc(bNodeType *ntype)
{
switch (ntype->type) {
@@@ -3207,9 -3226,15 +3233,18 @@@
case GEO_NODE_ATTRIBUTE_MATH:
ntype->draw_buttons = node_geometry_buts_attribute_math;
break;
+ case GEO_NODE_POINT_INSTANCE:
+ ntype->draw_buttons = node_geometry_buts_point_instance;
+ break;
+ case GEO_NODE_ATTRIBUTE_FILL:
+ ntype->draw_buttons = node_geometry_buts_attribute_fill;
+ break;
+ case GEO_NODE_ATTRIBUTE_MIX:
+ ntype->draw_buttons = node_geometry_buts_attribute_mix;
+ break;
+ case GEO_NODE_POINT_DISTRIBUTE:
+ ntype->draw_buttons = node_geometry_buts_attribute_point_distribute;
+ break;
}
}
diff --cc source/blender/makesrna/intern/rna_nodetree.c
index 7e66833bd57,34d922fe2c8..e3017bf10a2
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@@ -435,19 -437,20 +437,34 @@@ static const EnumPropertyItem rna_node_
{0, NULL, 0, NULL, NULL},
};
+ static const EnumPropertyItem rna_node_geometry_attribute_factor_input_type_items[] = {
+ {GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE, "ATTRIBUTE", 0, "Attribute", ""},
+ {GEO_NODE_ATTRIBUTE_INPUT_FLOAT, "FLOAT", 0, "Float", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ static const EnumPropertyItem rna_node_geometry_attribute_input_type_items[] = {
+ {GEO_NODE_ATTRIBUTE_INPUT_ATTRIBUTE, "ATTRIBUTE", 0, "Attribute", ""},
+ {GEO_NODE_ATTRIBUTE_INPUT_FLOAT, "FLOAT", 0, "Float", ""},
+ {GEO_NODE_ATTRIBUTE_INPUT_VECTOR, "VECTOR", 0, "Vector", ""},
+ {GEO_NODE_ATTRIBUTE_INPUT_COLOR, "COLOR", 0, "Color", ""},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+static const EnumPropertyItem rna_node_geometry_point_distribute_method_items[] = {
+ {GEO_NODE_POINT_DISTRIBUTE_RANDOM,
+ "RANDOM",
+ 0,
+ "Random",
+ "Distribute points randomly inside the domain"},
+ {GEO_NODE_POINT_DISTRIBUTE_POISSON,
+ "POISSON",
+ 0,
+ "Poisson Disk",
+ "Distribute points inside the domain evenly with a Poisson disk distribution"},
+ {0, NULL, 0, NULL, NULL},
+};
++
#endif
#ifdef RNA_RUNTIME
@@@ -8381,18 -8415,60 +8429,72 @@@ static void def_geo_attribute_math(Stru
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
+ static void def_geo_point_instance(StructRNA *srna)
+ {
+ static const EnumPropertyItem instance_type_items[] = {
+ {GEO_NODE_POINT_INSTANCE_TYPE_OBJECT,
+ "OBJECT",
+ ICON_NONE,
+ "Object",
+ "Instance an individual object on all points"},
+ {GEO_NODE_POINT_INSTANCE_TYPE_COLLECTION,
+ "COLLECTION",
+ ICON_NONE,
+ "Collection",
+ "Instance an entire collection on all points"},
+ {0, NULL, 0, NULL, NULL},
+ };
+
+ PropertyRNA *prop;
+
+ prop = RNA_def_property(srna, "instance_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, instance_type_items);
+ RNA_def_property_enum_default(prop, GEO_NODE_POINT_INSTANCE_TYPE_OBJECT);
+ RNA_def_property_ui_text(prop, "Instance Type", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+ }
+
+ static void def_geo_attribute_mix(StructRNA *srna)
+ {
+ PropertyRNA *prop;
+
+ RNA_def_struct_sdna_from(srna, "NodeAttributeMix", "storage");
+
+ prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_enum_ramp_blend_items);
+ RNA_def_property_enum_default(prop, MA_RAMP_BLEND);
+ RNA_def_property_ui_text(prop, "Blending Mode", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+
+ prop = RNA_def_property(srna, "input_type_factor", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_node_geometry_attribute_factor_input_type_items);
+ RNA_def_property_ui_text(prop, "Input Type Factor", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+
+ prop = RNA_def_property(srna, "input_type_a", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items);
+ RNA_def_property_ui_text(prop, "Input Type A", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+
+ prop = RNA_def_property(srna, "input_type_b", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_node_geometry_attribute_input_type_items);
+ RNA_def_property_ui_text(prop, "Input Type B", "");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+ }
+
+static void def_geo_point_distribute(StructRNA *srna)
+{
+ PropertyRNA *prop;
+
+ prop = RNA_def_property(srna, "distribute_method", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_sdna(prop, NULL, "custom1");
+ RNA_def_property_enum_items(prop, rna_node_geometry_point_distribute_method_items);
+ RNA_def_property_enum_default(prop, GEO_NODE_POINT_DISTRIBUTE_RANDOM);
+ RNA_def_property_ui_text(prop, "Distribution Method", "Method to use for scattering points");
+ RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
+}
+
/* -------------------------------------------------------------------------- */
static void rna_def_shader_node(BlenderRNA *brna)
diff --cc source/blender/nodes/CMakeLists.txt
index 2fef29ecd11,11852f6f723..a6ebf55640d
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@@ -138,17 -138,18 +138,19 @@@ set(SR
function/nodes/node_fn_switch.cc
function/node_function_util.cc
+ geometry/nodes/node_geo_attribute_fill.cc
geometry/nodes/node_geo_attribute_math.cc
- geometry/nodes/node_geo_common.cc
geometry/nodes/node_geo_boolean.cc
+ geometry/nodes/node_geo_common.cc
geometry/nodes/node_geo_edge_split.cc
geometry/nodes/node_geo_join_geometry.cc
+ geometry/nodes/node_geo_attribute_mix.cc
geometry/nodes/node_geo_object_info.cc
- geometry/nodes/node_geo_subdivision_surface.cc
geometry/nodes/node_geo_point_distribute.cc
+ geometry/nodes/node_geo_point_distribute_poisson_disk.cc
geometry/nodes/node_geo_point_instance.cc
geometry/nodes/node_geo_random_attribute.cc
+ geometry/nodes/node_geo_subdivision_surface.cc
geometry/nodes/node_geo_transform.cc
geometry/nodes/node_geo_triangulate.cc
geometry/node_geometry_exec.cc
diff --cc source/blender/nodes/NOD_static_types.h
index fff4bb2e43c,491f49cf425..08e892fe7f9
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@@ -271,8 -271,8 +271,8 @@@ DefNode(GeometryNode, GEO_NODE_EDGE_SPL
DefNode(GeometryNode, GEO_NODE_TRANSFORM, 0, "TRANSFORM", Transform, "Transform", "")
DefNode(GeometryNode, GEO_NODE_SUBDIVISION_SURFACE, 0, "SUBDIVISION_SURFACE", SubdivisionSurface, "Subdivision Surface", "")
DefNode(GeometryNode, GEO_NODE_BOOLEAN, def_geo_boolean, "BOOLEAN", Boolean, "Boolean", "")
-DefNode(GeometryNode, GEO_NODE_POINT_DISTRIBUTE, 0, "POINT_DISTRIBUTE", PointDistribute, "Point Distribute", "")
+DefNode(GeometryNode, GEO_NODE_POINT_DISTRIBUTE, def_geo_point_distribute, "POINT_DISTRIBUTE", PointDistribute, "Point Distribute", "")
- DefNode(GeometryNode, GEO_NODE_POINT_INSTANCE, 0, "POINT_INSTANCE", PointInstance, "Point Instance", "")
+ DefNode(GeometryNode, GEO_NODE_POINT_INSTANCE, def_geo_point_instance, "POINT_INSTANCE", PointInstance, "Point Instance", "")
DefNode(GeometryNode, GEO_NODE_OBJECT_INFO, 0, "OBJECT_INFO", ObjectInfo, "Object Info", "")
DefNode(GeometryNode, GEO_NODE_RANDOM_ATTRIBUTE, def_geo_random_attribute, "RANDOM_ATTRIBUTE", RandomAttribute, "Random Attribute", "")
DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MATH, def_geo_attribute_math, "ATTRIBUTE_MATH", AttributeMath, "Attribute Math", "")
More information about the Bf-blender-cvs
mailing list