[Bf-blender-cvs] [3093f894989] geometry-nodes: Geometry Nodes: Add null check for modifier property UI functions

Hans Goudey noreply at git.blender.org
Thu Nov 12 20:47:24 CET 2020


Commit: 3093f8949895a9803feab1cbd6856fda2a5fee22
Author: Hans Goudey
Date:   Thu Nov 12 14:47:17 2020 -0500
Branches: geometry-nodes
https://developer.blender.org/rB3093f8949895a9803feab1cbd6856fda2a5fee22

Geometry Nodes: Add null check for modifier property UI functions

An ID IDProperty exposed to the modifier  (object, material, etc) does not
have min, max, etc. values, so they should not be required.

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

M	source/blender/modifiers/intern/MOD_nodes.cc

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

diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc
index d4e355e4d0f..b11ec4b46da 100644
--- a/source/blender/modifiers/intern/MOD_nodes.cc
+++ b/source/blender/modifiers/intern/MOD_nodes.cc
@@ -423,11 +423,17 @@ static IDProperty *socket_add_property(IDProperty *settings_prop_group,
   }
 
   /* Create the properties for the socket's UI settings. */
-  IDP_AddToGroup(prop_ui_group, property_type.create_min_ui_prop(socket, "min"));
-  IDP_AddToGroup(prop_ui_group, property_type.create_min_ui_prop(socket, "soft_min"));
-  IDP_AddToGroup(prop_ui_group, property_type.create_max_ui_prop(socket, "max"));
-  IDP_AddToGroup(prop_ui_group, property_type.create_max_ui_prop(socket, "soft_max"));
-  IDP_AddToGroup(prop_ui_group, property_type.create_default_ui_prop(socket, "default"));
+  if (property_type.create_min_ui_prop != nullptr) {
+    IDP_AddToGroup(prop_ui_group, property_type.create_min_ui_prop(socket, "min"));
+    IDP_AddToGroup(prop_ui_group, property_type.create_min_ui_prop(socket, "soft_min"));
+  }
+  if (property_type.create_max_ui_prop != nullptr) {
+    IDP_AddToGroup(prop_ui_group, property_type.create_max_ui_prop(socket, "max"));
+    IDP_AddToGroup(prop_ui_group, property_type.create_max_ui_prop(socket, "soft_max"));
+  }
+  if (property_type.create_default_ui_prop != nullptr) {
+    IDP_AddToGroup(prop_ui_group, property_type.create_default_ui_prop(socket, "default"));
+  }
   if (property_type.rna_subtype_get != nullptr) {
     const char *subtype_identifier = nullptr;
     RNA_enum_identifier(rna_enum_property_subtype_items,



More information about the Bf-blender-cvs mailing list