[Bf-blender-cvs] [33a34c920a9] temp-geometry-nodes-mix-attributes: cleanup

Jacques Lucke noreply at git.blender.org
Wed Dec 9 15:03:30 CET 2020


Commit: 33a34c920a9deb4ef74119e2cd7985e941ba05da
Author: Jacques Lucke
Date:   Wed Dec 9 13:51:19 2020 +0100
Branches: temp-geometry-nodes-mix-attributes
https://developer.blender.org/rB33a34c920a9deb4ef74119e2cd7985e941ba05da

cleanup

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

M	source/blender/makesdna/DNA_node_types.h
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc

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

diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h
index 2aa0bb961b0..b4ca65403ae 100644
--- a/source/blender/makesdna/DNA_node_types.h
+++ b/source/blender/makesdna/DNA_node_types.h
@@ -1476,9 +1476,9 @@ typedef enum GeometryNodeUseAttributeFlag {
 
 typedef enum GeometryNodeAttributeInputMode {
   GEO_NODE_ATTRIBUTE_INPUT__ATTRIBUTE = 0,
-  GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_FLOAT = 1,
-  GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_VECTOR = 2,
-  GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_COLOR = 3,
+  GEO_NODE_ATTRIBUTE_INPUT__FLOAT = 1,
+  GEO_NODE_ATTRIBUTE_INPUT__VECTOR = 2,
+  GEO_NODE_ATTRIBUTE_INPUT__COLOR = 3,
 } GeometryNodeAttributeInputMode;
 
 #ifdef __cplusplus
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index e413902cbc3..38ad3f76f2a 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -437,15 +437,15 @@ static const EnumPropertyItem rna_node_geometry_attribute_input_b_items[] = {
 
 static const EnumPropertyItem rna_node_geometry_attribute_factor_input_type_items[] = {
     {GEO_NODE_ATTRIBUTE_INPUT__ATTRIBUTE, "ATTRIBUTE", 0, "Attribute", ""},
-    {GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_FLOAT, "FLOAT", 0, "Float", ""},
+    {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__CONSTANT_FLOAT, "FLOAT", 0, "Float", ""},
-    {GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_VECTOR, "VECTOR", 0, "Vector", ""},
-    {GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_COLOR, "COLOR", 0, "Color", ""},
+    {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},
 };
 
diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
index f3316dfdbb9..373d0fdf766 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_mix.cc
@@ -128,17 +128,17 @@ static void attribute_mix_calc(GeometryComponent &component, const GeoNodeExecPa
       const std::string name = params.get_input<std::string>("Attribute A");
       return component.attribute_get_for_read(name, result_domain, result_type, nullptr);
     }
-    else if (node_storage->input_type_a == GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_FLOAT) {
+    else if (node_storage->input_type_a == GEO_NODE_ATTRIBUTE_INPUT__FLOAT) {
       const float value = params.get_input<float>("Attribute A_001");
       return component.attribute_get_constant_for_read_converted(
           result_domain, CD_PROP_FLOAT, result_type, &value);
     }
-    else if (node_storage->input_type_a == GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_VECTOR) {
+    else if (node_storage->input_type_a == GEO_NODE_ATTRIBUTE_INPUT__VECTOR) {
       const float3 value = params.get_input<float3>("Attribute A_002");
       return component.attribute_get_constant_for_read_converted(
           result_domain, CD_PROP_FLOAT3, result_type, &value);
     }
-    else if (node_storage->input_type_a == GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_COLOR) {
+    else if (node_storage->input_type_a == GEO_NODE_ATTRIBUTE_INPUT__COLOR) {
       const Color4f value = params.get_input<Color4f>("Attribute A_003");
       return component.attribute_get_constant_for_read_converted(
           result_domain, CD_PROP_COLOR, result_type, &value);
@@ -203,7 +203,7 @@ static void geo_node_attribute_mix_init(bNodeTree *UNUSED(ntree), bNode *node)
   NodeAttributeMix *data = (NodeAttributeMix *)MEM_callocN(sizeof(NodeAttributeMix),
                                                            "attribute mix node");
   data->blend_type = MA_RAMP_BLEND;
-  data->input_type_factor = GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_FLOAT;
+  data->input_type_factor = GEO_NODE_ATTRIBUTE_INPUT__FLOAT;
   data->input_type_a = GEO_NODE_ATTRIBUTE_INPUT__ATTRIBUTE;
   data->input_type_b = GEO_NODE_ATTRIBUTE_INPUT__ATTRIBUTE;
   node->storage = data;
@@ -218,9 +218,9 @@ static void update_attribute_input_socket_availabilities(bNode &node,
     if (BLI_str_startswith(socket->name, prefix)) {
       const bool is_available =
           ((socket->type == SOCK_STRING && mode_ == GEO_NODE_ATTRIBUTE_INPUT__ATTRIBUTE) ||
-           (socket->type == SOCK_FLOAT && mode_ == GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_FLOAT) ||
-           (socket->type == SOCK_VECTOR && mode_ == GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_VECTOR) ||
-           (socket->type == SOCK_RGBA && mode_ == GEO_NODE_ATTRIBUTE_INPUT__CONSTANT_COLOR));
+           (socket->type == SOCK_FLOAT && mode_ == GEO_NODE_ATTRIBUTE_INPUT__FLOAT) ||
+           (socket->type == SOCK_VECTOR && mode_ == GEO_NODE_ATTRIBUTE_INPUT__VECTOR) ||
+           (socket->type == SOCK_RGBA && mode_ == GEO_NODE_ATTRIBUTE_INPUT__COLOR));
       nodeSetSocketAvailability(socket, is_available);
     }
   }



More information about the Bf-blender-cvs mailing list