Page MenuHome

Fix T85356: Geometry Nodes graph animation not showing in Animation Editors
AbandonedPublic

Authored by Philipp Oeser (lichtwerk) on Feb 4 2021, 5:12 PM.

Details

Summary

This just needed another entry in 'animdata_filter_dopesheet_ob' to loop
over (geometry nodes) modifiers and process their nodetrees animdata via
the (already existing) animdata_filter_ds_nodetree.

Diff Detail

Repository
rB Blender
Branch
T85356 (branched from master)
Build Status
Buildable 12627
Build 12627: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Feb 4 2021, 5:12 PM

The animdata_filter_ds_modifiers() function already loops over animation data from modifiers. Wouldn't it be possible to extend animfilter_modifier_idpoin_cb() (used by animdata_filter_ds_modifiers()) to handle node trees?

The animdata_filter_ds_modifiers() function already loops over animation data from modifiers. Wouldn't it be possible to extend animfilter_modifier_idpoin_cb() (used by animdata_filter_ds_modifiers()) to handle node trees?

BKE_modifiers_foreach_ID_link / animfilter_modifier_idpoin_cb is just for IDs referenced in modifiers (e.g. textures), see the comment above animdata_filter_ds_modifiers

we could consider including that animdata for geonodetrees as well, but I would still think this needs to be separated from animdata_filter_ds_modifiers

animfilter_modifier_idpoin_cb is just for IDs referenced in modifiers (e.g. textures), see the comment above animdata_filter_ds_modifiers

In what way is a bNodeTree not an ID referenced in a modifier?

animfilter_modifier_idpoin_cb is just for IDs referenced in modifiers (e.g. textures), see the comment above animdata_filter_ds_modifiers

In what way is a bNodeTree not an ID referenced in a modifier?

afaict, it is only for IDs in node properties, see foreachIDLink in MOD_nodes.cc

I still don't understand what you mean. This patch seems to work fine on the test file from T85356:

diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index f2022194ed5..a03f19d0111 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -2403,6 +2403,13 @@ static void animfilter_modifier_idpoin_cb(void *afm_ptr,
       }
       break;
     }
+    case ID_NT: {
+      bNodeTree *node_tree = (bNodeTree *)id;
+      if (!(afm->ads->filterflag & ADS_FILTER_NONTREE)) {
+        afm->items += animdata_filter_ds_nodetree(
+            afm->ac, &afm->tmp_data, afm->ads, owner_id, node_tree, afm->filter_mode);
+      }
+    }
 
     /* TODO: images? */
     default:

This approach extends the existing structure that loops over all modifiers and follows ID pointers. Extending it further when necessary is then just a matter of adding another case to the switch.

I still don't understand what you mean. This patch seems to work fine on the test file from T85356:

diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c
index f2022194ed5..a03f19d0111 100644
--- a/source/blender/editors/animation/anim_filter.c
+++ b/source/blender/editors/animation/anim_filter.c
@@ -2403,6 +2403,13 @@ static void animfilter_modifier_idpoin_cb(void *afm_ptr,
       }
       break;
     }
+    case ID_NT: {
+      bNodeTree *node_tree = (bNodeTree *)id;
+      if (!(afm->ads->filterflag & ADS_FILTER_NONTREE)) {
+        afm->items += animdata_filter_ds_nodetree(
+            afm->ac, &afm->tmp_data, afm->ads, owner_id, node_tree, afm->filter_mode);
+      }
+    }
 
     /* TODO: images? */
     default:

This approach extends the existing structure that loops over all modifiers and follows ID pointers. Extending it further when necessary is then just a matter of adding another case to the switch.

Interesting.
I was not aware that the nodetree is actually part of NodesModifierData->settings.properties (still looking where this is actually made part of it).
I was also reading the comment for animdata_filter_ds_modifiers wrong it seems.

But you are right, your solution seems more straightforward in the end.