[Bf-blender-cvs] [e0516d4d8e0] geometry-nodes: Geometry Nodes: Disallow editing and animating modifier active property

Hans Goudey noreply at git.blender.org
Thu Nov 19 20:44:28 CET 2020


Commit: e0516d4d8e0d48e1991c9eaa765a34036126cde1
Author: Hans Goudey
Date:   Thu Nov 19 14:44:20 2020 -0500
Branches: geometry-nodes
https://developer.blender.org/rBe0516d4d8e0d48e1991c9eaa765a34036126cde1

Geometry Nodes: Disallow editing and animating modifier active property

There will be an operator to access this property instead, which provides
a better name and tooltip to expose in the UI, and makes it more clear
that the property is dependent on the other modifiers.

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

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

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

diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 632c9bb9de3..022408ba32e 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -1541,29 +1541,6 @@ static bool rna_Modifier_show_expanded_get(PointerRNA *ptr)
   return md->ui_expand_flag & UI_PANEL_DATA_EXPAND_ROOT;
 }
 
-static void rna_Modifier_is_active_set(PointerRNA *ptr, bool value)
-{
-  ModifierData *md = ptr->data;
-
-  if (value) {
-    /* Disable the active flag of all other modifiers. */
-    for (ModifierData *prev_md = md->prev; prev_md != NULL; prev_md = prev_md->prev) {
-      prev_md->flag &= ~eModifierFlag_Active;
-    }
-    for (ModifierData *next_md = md->next; next_md != NULL; next_md = next_md->next) {
-      next_md->flag &= ~eModifierFlag_Active;
-    }
-  }
-
-  SET_FLAG_FROM_TEST(md->flag, value, eModifierFlag_Active);
-}
-
-static bool rna_Modifier_is_active_get(PointerRNA *ptr)
-{
-  ModifierData *md = ptr->data;
-  return md->flag & eModifierFlag_Active;
-}
-
 static int rna_MeshSequenceCacheModifier_has_velocity_get(PointerRNA *ptr)
 {
 #  ifdef WITH_ALEMBIC
@@ -7283,8 +7260,9 @@ void RNA_def_modifier(BlenderRNA *brna)
   RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
 
   prop = RNA_def_property(srna, "is_active", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_funcs(prop, "rna_Modifier_is_active_get", "rna_Modifier_is_active_set");
+  RNA_def_property_boolean_sdna(prop, NULL, "flag", eModifierFlag_Active);
   RNA_def_property_flag(prop, PROP_NO_DEG_UPDATE);
+  RNA_def_property_clear_flag(prop, PROP_ANIMATABLE | PROP_EDITABLE);
   RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);
   RNA_def_property_ui_text(prop, "Active", "The active modifier in the list");
   RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);



More information about the Bf-blender-cvs mailing list