[Bf-blender-cvs] [46e2f4761cd] geometry-nodes-attribute-nodes: Merge branch 'geometry-nodes' into geometry-nodes-attribute-nodes

Hans Goudey noreply at git.blender.org
Tue Nov 17 15:22:40 CET 2020


Commit: 46e2f4761cda941b891bfc2abfa7a5188eff82c7
Author: Hans Goudey
Date:   Tue Nov 17 09:03:04 2020 -0500
Branches: geometry-nodes-attribute-nodes
https://developer.blender.org/rB46e2f4761cda941b891bfc2abfa7a5188eff82c7

Merge branch 'geometry-nodes' into geometry-nodes-attribute-nodes

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



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

diff --cc source/blender/blenkernel/BKE_node.h
index f61d3037ee3,5c2346f2c94..d822eb1efd7
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@@ -1347,9 -1344,7 +1344,9 @@@ int ntreeTexExecTree(struct bNodeTree *
  #define GEO_NODE_POINT_DISTRIBUTE 1004
  #define GEO_NODE_POINT_INSTANCE 1005
  #define GEO_NODE_SUBDIVISION_SURFACE 1006
- #define GEO_NODE_ATTRIBUTE_RANDOM 1007
- #define GEO_NODE_ATTRIBUTE_MATH 1008
- #define GEO_NODE_ATTRIBUTE_CREATE 1009
+ #define GEO_NODE_OBJECT_INFO 1007
++#define GEO_NODE_ATTRIBUTE_RANDOM 1008
++#define GEO_NODE_ATTRIBUTE_MATH 1009
  
  /** \} */
  
diff --cc source/blender/makesrna/intern/rna_nodetree.c
index ffab5b88f5b,ec93fd0aac4..fd08815c46c
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@@ -8173,45 -8238,24 +8240,60 @@@ static void def_geo_boolean(StructRNA *
    RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }
  
- static void def_geo_attribute_common(StructRNA *srna)
++static void def_geo_attribute_create_common(StructRNA *srna)
 +{
 +  PropertyRNA *prop;
 +
 +  prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
 +  RNA_def_property_enum_sdna(prop, NULL, "custom1");
 +  RNA_def_property_enum_items(prop, rna_enum_attribute_type_items);
 +  RNA_def_property_enum_default(prop, CD_PROP_FLOAT);
 +  RNA_def_property_ui_text(prop, "Data Type", "Type of data stored in attribute");
 +  RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 +
 +  prop = RNA_def_property(srna, "domain", PROP_ENUM, PROP_NONE);
 +  RNA_def_property_enum_sdna(prop, NULL, "custom2");
 +  RNA_def_property_enum_items(prop, rna_enum_attribute_domain_items);
 +  RNA_def_property_enum_default(prop, ATTR_DOMAIN_VERTEX);
 +  RNA_def_property_ui_text(prop, "Domain", "");
 +  RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 +}
 +
- static void def_geo_attribute_create(StructRNA *srna)
- {
-   def_geo_attribute_common(srna);
- }
- 
 +static void def_geo_attribute_math(StructRNA *srna)
 +{
 +  PropertyRNA *prop;
 +
 +  prop = RNA_def_property(srna, "operation", PROP_ENUM, PROP_NONE);
 +  RNA_def_property_enum_sdna(prop, NULL, "custom1");
 +  RNA_def_property_enum_items(prop, rna_enum_node_vec_math_items);
 +  RNA_def_property_enum_default(prop, NODE_VECTOR_MATH_ADD);
 +  RNA_def_property_ui_text(prop, "Operation", "");
 +  RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
 +}
 +
 +static void def_geo_attribute_random(StructRNA *srna)
 +{
-   def_geo_attribute_common(srna);
++  def_geo_attribute_create_common(srna);
++}
++
+ static void def_geo_triangulate(StructRNA *srna)
+ {
+   PropertyRNA *prop;
+ 
+   prop = RNA_def_property(srna, "quad_method", PROP_ENUM, PROP_NONE);
+   RNA_def_property_enum_sdna(prop, NULL, "custom1");
+   RNA_def_property_enum_items(prop, rna_node_geometry_triangulate_quad_method_items);
+   RNA_def_property_enum_default(prop, GEO_NODE_TRIANGULATE_QUAD_SHORTEDGE);
+   RNA_def_property_ui_text(prop, "Quad Method", "Method for splitting the quads into triangles");
+   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
+ 
+   prop = RNA_def_property(srna, "ngon_method", PROP_ENUM, PROP_NONE);
+   RNA_def_property_enum_sdna(prop, NULL, "custom2");
+   RNA_def_property_enum_items(prop, rna_node_geometry_triangulate_ngon_method_items);
+   RNA_def_property_enum_default(prop, GEO_NODE_TRIANGULATE_NGON_BEAUTY);
+   RNA_def_property_ui_text(
+       prop, "Polygon Method", "Method for splitting the polygons into triangles");
+   RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
  }
  
  /* -------------------------------------------------------------------------- */
diff --cc source/blender/nodes/NOD_static_types.h
index f0582ed4b0f,af07ba87c84..1aab202909e
--- a/source/blender/nodes/NOD_static_types.h
+++ b/source/blender/nodes/NOD_static_types.h
@@@ -273,10 -273,7 +273,10 @@@ DefNode(GeometryNode, GEO_NODE_SUBDIVIS
  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_INSTANCE, 0, "POINT_INSTANCE", PointInstance, "Point Instance", "")
+ DefNode(GeometryNode, GEO_NODE_OBJECT_INFO, 0, "OBJECT_INFO", ObjectInfo, "Object Info", "")
 +DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_RANDOM, def_geo_attribute_random, "ATTRIBUTE_RANDOM", RandomAttribute, "Random Attribute", "")
 +DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_MATH, def_geo_attribute_math, "ATTRIBUTE_MATH", AttributeMath, "Attribute Math", "")
- DefNode(GeometryNode, GEO_NODE_ATTRIBUTE_CREATE, def_geo_attribute_create, "ATTRIBUTE_CREATE", CreateAttribute, "Create Attribute", "")
 +
  
  /* undefine macros */
  #undef DefNode



More information about the Bf-blender-cvs mailing list