Advanced parameter driver operations/formula support
Dor․
It would be nice to have "advanced" Parameter Driver operators to:
- Set/unset bits (if it’s one entry, it should display up to 32 bits as this may be used locally as well, and for synced parameters highlight the “synced” bits in some way like an alternate background)
- AND/OR bits between two parameters
- Add/subtract/multiply/divide one parameter with another
- Copy parameters from X bits to Y bits, this could be used, for example, to “pack” multiple parameters in multiplexing systems, or in save systems (saving multiple synced parameters into a single one since the local one is 32 bits, and loading from one into multiple). Right now without horribly inefficient animator logic it’s practically impossible to set every bit in an int by a bool or set multiple bools via int bits (it’s possible, but it spans multiple frames due to multiple transition evaluations, or requires defining hundreds of transitions, one for each possibility, instead of nesting them), requiring us to create multiplexing int(s) alongside multiplexing bool(s), with these options we could slow down updates to as little as 1 bit per parameter update regardless of type, or reduce wasteful allocations and instead allocate just the the largest bit width used, and fill it with smaller types when the “large” types aren’t currently being synced.
An alternative to defining specific additional operations, though I suspect far less likely (especially since you don’t want to encourage further uses of animators for logic, but I’d hope that any alternative we get would support this in the future so this work could be translated whenever the animator exodus happens), maybe an expression/formula operator, where a parameter list is converted to variables (since parameter names aren’t always valid variable names conversion in some form would be necessary, I’m imagining A through Z), and an expression could be performed using them, for example:
C = A + B; D = (B & (1 << 3)) != 0; E *= 3;
This would give us access to a lot of mathematical operations that are either impossible, impractical, or require complex (blendtree) setups, and could carry forward to action drivers and other animator alternatives in the future.
Originally posted on the forums here
Log In