[Bf-blender-cvs] [ee745e2f8cc] temp-geometry-nodes-sample-texture: Merge branch 'master' into temp-geometry-nodes-sample-texture

Jacques Lucke noreply at git.blender.org
Fri Dec 18 13:56:06 CET 2020


Commit: ee745e2f8cc73b69af94fe018de4d13bb914d6e7
Author: Jacques Lucke
Date:   Fri Dec 18 13:55:59 2020 +0100
Branches: temp-geometry-nodes-sample-texture
https://developer.blender.org/rBee745e2f8cc73b69af94fe018de4d13bb914d6e7

Merge branch 'master' into temp-geometry-nodes-sample-texture

===================================================================



===================================================================

diff --cc release/scripts/startup/nodeitems_builtins.py
index ed901658700,8552b4017e9..6753f46e767
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@@ -493,9 -495,7 +495,8 @@@ geometry_node_categories = 
      ]),
      GeometryNodeCategory("GEO_GEOMETRY", "Geometry", items=[
          NodeItem("GeometryNodeTransform"),
-         NodeItem("GeometryNodeBoolean"),
          NodeItem("GeometryNodeJoinGeometry"),
 +        NodeItem("GeometryNodeSampleTexture"),
      ]),
      GeometryNodeCategory("GEO_INPUT", "Input", items=[
          NodeItem("GeometryNodeObjectInfo"),
diff --cc source/blender/blenkernel/BKE_node.h
index 7add346a9b4,bc254b81afb..51f7f18ff64
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -1352,7 -1352,9 +1352,10 @@@ int ntreeTexExecTree(struct bNodeTree *
  #define GEO_NODE_JOIN_GEOMETRY 1010
  #define GEO_NODE_ATTRIBUTE_FILL 1011
  #define GEO_NODE_ATTRIBUTE_MIX 1012
- #define GEO_NODE_SAMPLE_TEXTURE 1013
+ #define GEO_NODE_ATTRIBUTE_COLOR_RAMP 1013
+ #define GEO_NODE_POINT_SEPARATE 1014
+ #define GEO_NODE_ATTRIBUTE_COMPARE 1015
++#define GEO_NODE_SAMPLE_TEXTURE 1016
  
  /** \} */
  
diff --cc source/blender/blenkernel/intern/node.c
index f50af18c1a3,5af49802868..9784a79b15a
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@@ -4741,7 -4743,7 +4743,8 @@@ static void registerGeometryNodes(void
    register_node_type_geo_attribute_math();
    register_node_type_geo_join_geometry();
    register_node_type_geo_attribute_mix();
+   register_node_type_geo_attribute_color_ramp();
 +  register_node_type_geo_sample_texture();
  }
  
  static void registerFunctionNodes(void)
diff --cc source/blender/editors/space_node/drawnode.c
index b10962e8d3b,b6744719cad..d25507c4573
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@@ -3208,14 -3217,20 +3217,28 @@@ static void node_geometry_buts_attribut
    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_buts_attribute_color_ramp(uiLayout *layout,
+                                                     bContext *UNUSED(C),
+                                                     PointerRNA *ptr)
+ {
+   uiTemplateColorRamp(layout, ptr, "color_ramp", 0);
+ }
+ 
 +static void node_geometry_buts_sample_texture(uiLayout *layout,
 +                                              bContext *UNUSED(C),
 +                                              PointerRNA *ptr)
 +{
 +  uiItemR(layout, ptr, "mode", DEFAULT_FLAGS, "", ICON_NONE);
 +  uiItemR(layout, ptr, "texture", DEFAULT_FLAGS, "", ICON_NONE);
 +}
 +
  static void node_geometry_set_butfunc(bNodeType *ntype)
  {
    switch (ntype->type) {
@@@ -3243,9 -3261,12 +3269,15 @@@
      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;
+     case GEO_NODE_ATTRIBUTE_COLOR_RAMP:
+       ntype->draw_buttons = node_geometry_buts_attribute_color_ramp;
+       break;
 +    case GEO_NODE_SAMPLE_TEXTURE:
 +      ntype->draw_buttons = node_geometry_buts_sample_texture;
 +      break;
    }
  }
  
diff --cc source/blender/makesdna/DNA_node_types.h
index af73cbdec66,d6b5e3ed493..7759536eaf8
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@@ -1499,13 -1524,14 +1524,19 @@@ typedef enum GeometryNodeAttributeInput
    GEO_NODE_ATTRIBUTE_INPUT_FLOAT = 1,
    GEO_NODE_ATTRIBUTE_INPUT_VECTOR = 2,
    GEO_NODE_ATTRIBUTE_INPUT_COLOR = 3,
+   GEO_NODE_ATTRIBUTE_INPUT_BOOLEAN = 4,
  } GeometryNodeAttributeInputMode;
  
+ typedef enum GeometryNodePointDistributeMethod {
+   GEO_NODE_POINT_DISTRIBUTE_RANDOM = 0,
+   GEO_NODE_POINT_DISTRIBUTE_POISSON = 1,
+ } GeometryNodePointDistributeMethod;
+ 
 +typedef enum GeometryNodeSampleTextureMode {
 +  GEO_NODE_SAMPLE_TEXTURE_MODE_POSITION = 0,
 +  GEO_NODE_SAMPLE_TEXTURE_MODE_UV = 1,
 +} GeometryNodeSampleTextureMode;
 +
  #ifdef __cplusplus
  }
  #endif
diff --cc source/blender/makesrna/intern/rna_nodetree.c
index 9736039d8ab,25bfc70ef8f..82707b53fd1
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@@ -8481,39 -8532,53 +8532,86 @@@ static void def_geo_attribute_mix(Struc
    RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
  }
  
+ static void def_geo_attribute_attribute_compare(StructRNA *srna)
+ {
+   PropertyRNA *prop;
+ 
+   RNA_def_struct_sdna_from(srna, "NodeAttributeCompare", "storage");
+ 
+   prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
+   RNA_def_property_enum_items(prop, rna_enum_node_float_compare_items);
+   RNA_def_property_enum_default(prop, NODE_MATH_ADD);
+   RNA_def_property_ui_text(prop, "Operation", "");
+   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_any);
+   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_any);
+   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 def_geo_attribute_color_ramp(StructRNA *srna)
+ {
+   PropertyRNA *prop;
+ 
+   RNA_def_struct_sdna_from(srna, "NodeAttributeColorRamp", "storage");
+ 
+   prop = RNA_def_property(srna, "color_ramp", PROP_POINTER, PROP_NONE);
+   RNA_def_property_struct_type(prop, "ColorRamp");
+   RNA_def_property_ui_text(prop, "Color Ramp", "");
+   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+ }
+ 
 +static void def_geo_sample_texture(StructRNA *srna)
 +{
 +  static const EnumPropertyItem instance_type_items[] = {
 +      {GEO_NODE_SAMPLE_TEXTURE_MODE_POSITION,
 +       "POSITION",
 +       ICON_NONE,
 +       "Position",
 +       "Use the position attribute to sample the texture"},
 +      {GEO_NODE_SAMPLE_TEXTURE_MODE_UV,
 +       "UV",
 +       ICON_NONE,
 +       "UV",
 +       "Use a UV map attribute to sample the texture"},
 +      {0, NULL, 0, NULL, NULL},
 +  };
 +
 +  PropertyRNA *prop;
 +
 +  prop = RNA_def_property(srna, "texture", PROP_POINTER, PROP_NONE);
 +  RNA_def_property_pointer_sdna(prop, NULL, "id");
 +  RNA_def_property_struct_type(prop, "Texture");
 +  RNA_def_property_flag(prop, PROP_EDITABLE | PROP_ID_REFCOUNT);
 +  RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
 +  RNA_def_property_ui_text(prop, "Texture", "Texture to sample values from");
 +  RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update_relations");
 +
 +  prop = RNA_def_property(srna, "mode", PROP_ENUM, PROP_NONE);
 +  RNA_def_property_enum_sdna(prop, NULL, "custom1");
 +  RNA_def_property_enum_items(prop, instance_type_items);
 +  RNA_def_property_ui_text(prop, "Mode", "");
 +  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 9412e1ced97,866cf74d35b..021dd771781
--- a/source/blender/nodes/CMakeLists.txt
+++ b/source/blender/nodes/CMakeLists.txt
@@@ -147,9 -151,9 +151,10 @@@ set(SR
    geometry/nodes/node_geo_attribute_mix.cc
    geometry/nodes/node_geo_object_info.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_sample_texture.cc
+   geometry/nodes/node_geo_point_separate.cc
    geometry/nodes/node_geo_subdivision_surface.cc
    geometry/nodes/node_geo_transform.cc
    geometry/nodes/node_geo_triangulate.cc
diff --cc source/blender/nodes/NOD_geometry.h
index aa068a7ed8f,19a7acf2299..dfc3aa0b55b
--- a/source/blender/nodes/NOD_geometry.h
+++ b/source/blender/nodes/NOD_geometry.h
@@@ -35,11 -35,13 +35,14 @@@ void register_node_type_geo_triangulate
  void register_node_type_geo_point_distribute(void);
  void register_node_type_geo_point_instance(void);
  void register_node_type_geo_object_info(void);
- void register_node_type_geo_random_attribute(void);
+ void register_node_type_geo_attribute_randomize(void);
  void register_node_type_geo_attribute_math(void);
  void register_node_type_geo_join_geometry(void);
+ void register_node_type_geo_point_separate(void);
+ void register_node_type_geo_attribute_compare(void);
  void register_node_type_geo_attribute_mix(void);
+ void register_node_type_geo_attribute_color_ramp(void);
 +void register_node_type_geo_sample_texture(void);
  
  #ifdef __cplusplus
  }
diff --cc source/blender/nodes/NOD_static_types.h
index 45d60f071d7,5b61594cca1..a860b2a708d
--- a/source/blender/nodes/NOD_static_type

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list