[Bf-blender-cvs] [9a94a369026] geometry-nodes-mix-attributes: subset of blend modes, crashes still

Jacques Lucke noreply at git.blender.org
Tue Dec 1 16:08:26 CET 2020


Commit: 9a94a369026c6ad9557ca8b16223990f8ab07436
Author: Jacques Lucke
Date:   Tue Dec 1 13:52:52 2020 +0100
Branches: geometry-nodes-mix-attributes
https://developer.blender.org/rB9a94a369026c6ad9557ca8b16223990f8ab07436

subset of blend modes, crashes still

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

M	source/blender/makesrna/intern/rna_nodetree.c

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

diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index a096f56842b..75716bd60a2 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -1895,6 +1895,19 @@ static const EnumPropertyItem *rna_GeometryNodeAttributeMath_operation_itemf(
   return itemf_function_check(rna_enum_node_math_items, attribute_math_operation_supported);
 }
 
+static bool mix_attributes_blend_mode_supported(const EnumPropertyItem *item)
+{
+  return ELEM(item->value, MA_RAMP_BLEND, MA_RAMP_ADD, MA_RAMP_SUB) && item->identifier[0] != '\0';
+}
+static bool rna_GeometryNodeMixAttributes_operation_itemf(bContext *UNUSED(C),
+                                                          PointerRNA *UNUSED(ptr),
+                                                          PropertyRNA *UNUSED(prop),
+                                                          bool *r_free)
+{
+  *r_free = true;
+  return itemf_function_check(rna_enum_ramp_blend_items, mix_attributes_blend_mode_supported);
+}
+
 static StructRNA *rna_ShaderNode_register(Main *bmain,
                                           ReportList *reports,
                                           void *data,
@@ -8375,6 +8388,8 @@ static void def_geo_mix_attributes(StructRNA *srna)
   prop = RNA_def_property(srna, "blend_type", PROP_ENUM, PROP_NONE);
   RNA_def_property_enum_sdna(prop, NULL, "custom1");
   RNA_def_property_enum_items(prop, rna_enum_ramp_blend_items);
+  RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_GeometryNodeMixAttributes_operation_itemf");
+  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");
 }



More information about the Bf-blender-cvs mailing list