What is folded data and/or properties?

Ever since I updated to UE5 from 4.26, i see the term “folded data/property” everywhere in the AnimNode source files, and there seems to be a new meta property specifier called “FoldProperty”. As well as a special Macro “GET_ANIM_NODE_DATA” for accessing folded properties for anim nodes. There doesn’t seem to be any documentation either. My guess is it might have something to do with the fact that we can tag anim nodes and get AnimNodeReferences in Blueprint, but unsure. Any one familiar with this term or concept?

2 Likes

I have the same question and I read through the relevant code. Although I didn’t fully understand it, I think it’s like this.

FoldProperty, as its name suggests, is designed to save some memory. FoldProperty are wrapped with WITH_EDITOR_DATA, which means that when the game is published, these member variables do not exist and they are stored elsewhere. You can mark these properties as dynamic or expose as pin in the anim graph. If you don’t do this, the engine will treat them as constants, and if there are multiple instances of this animation blueprint, the constant will only be saved once.

3 Likes