[Bf-funboard] Autocorrect NLA Blend Modes

eb98hh0httw5-blender at yahoo.com eb98hh0httw5-blender at yahoo.com
Mon Mar 5 17:36:02 CET 2018

Sometimes people will talk about ("layers" in Maya) in Blender but don't elaborate much and the basic explanation will suggest they're talking about basically what the NLA does. It's true the it "basically" is what the NLA does but the thing they're actually asking is "how" the programs use the blend modes. 
In Blender, the "Add" mode takes the exact values from the animation's curves and adds them together (or multiply/subtract modes). The problem is users aren't modifying numbers, they're using objects/bones and multiple values, and only seeing the numbers for the final position, but the NLA is taking the multiple final results of the strips and overblowing the values, ending with unusable results.
In Maya, the "Additive" layer (it only uses tracks, not strips in the track), it only adds an offset in the keyed ranges based on the difference between the "set/visual" result in the Add layer, and the "set/visual" result from the lower layers. 
Essentially the goal is to create an animation like normal, then on a separate layer, animate additional changes without completely overwriting the values from the lower tracks. (like with Child Of and 'offset' constraints)I created an addon to simulate/achieve this goal (https://blenderartists.org/forum/showthread.php?446220), however the method I use isn't optimal to be ran continuously (and modifies the final values) and believe it would be better if Blender handled this itself rather than a script. 
The "essential" math I perform to take a user's "intended/visual" result and correctly blend it with the other layer/track/strip's resulting values is: 
         new_value = current track
        old_value   = lower_tracks

        if blend_mode == 'ADD':                new_value = abs(old_value-new_value)
        if blend_mode == 'SUBTRACT':    new_value = abs(old_value-new_value) * -1 
        if blend_mode == 'MULTIPLY':      new_value = abs(new_value/old_value)

Since Blender basically already just assumes that every track is going to be "REPLACE", it could switch the key's values in a strip of the blend modes to be the difference between the values instead.
Assuming that having something like this would be of interest to someone (enough to code it), would it be as easy as it seems to me?  (to me, it seems like simply changing a few lines of code, maybe in multiple pages)

More information about the Bf-funboard mailing list