ERCs don't work in daz studio, so why we bother ? aka simplified ERCs

Issue #2158 resolved
Alessandro Padovani created an issue

4.2.0.2252, blender 4.2.0

It never fails to horrify me how unnecessary complicate ERCs are. To the point they will break and not work at all even in daz studio, as soon as we manipulate them long enough. This is especially bad for animation and to be considered a design flaw, as it is impossible to manage correctly due to dependency loops.

sample steps in daz studio:

  1. load G8
  2. eyes closed 100%
  3. eyes closed left 0%
  4. eyes closed 0%
  5. eyes closed 100%, ERC is broken and doesn't work anymore

What we could do in blender is to only load direct morphs in sliders, without ERCs. Then ERCs can be loaded and stored as usual, only to be used for daz animations not for user sliders.

For example we would only load in sliders "eyes closed left" "eyes closed right", which directly drive bones/shapekeys, not "eyes closed" which drives other morphs. We keep "eyes closed" as an internal expression to load daz animations, to be baked into "eyes closed left" "eyes closed right".

This would simplify the whole system with no need for "final values" anymore, as it isn't possible for the user to have values different from the sliders. This way we use blender morphs “the blender way”.

# load daz morphs
if the expression drives bones/shapekeys
    store into slider for user control
else
    store into internal ERC to be used for daz poses/animations

# load daz pose/animation
if the keyframe use a slider
    store into slider
else if the keyframe use a ERC
    evaluate the ERC and bake into sliders

Comments (24)

  1. Alessandro Padovani reporter

    p.s. I understand this would be a “major restyling” with possible new flaws, so may be not worth it. Nevertheless something to be aware of.

  2. Thomas Larsson repo owner

    Uh. I spent a lot of time to make the sliders behave as in DS. This may not be ideal from a Blender POW, but it is what an importer should do IMO. Doing something else will open a can of worms and definitely create lots of new bugs.

  3. Alessandro Padovani reporter

    Yes I understand, the idea is to simplify the blender setup and use baking for ERCs, but it is certainly requiring a fair amount of work on the code.

    One workaround we can use right now is to import by hand only the base morphs, excluding other morphs driving the base morphs. This requires to know exactly what morphs do, plus will not work to import daz animations. But at least it is doable.

    Feel free to close as wontfix if you’re not interested. Thank you for looking at this.

  4. Alessandro Padovani reporter

    update. important. known limitation/bug.

    Anyway, the current implementation doesn’t work, because ERCs has issues in daz studio itself as explained above. I packed a little eyes animation following the steps above and it produces completely different results in daz studio and blender.

    We can keep this open as task or bug for a limitation to be aware of. That is, morphs driving other morphs can’t always work in daz studio thus they can’t always work in blender as well, and may produce different results.

    steps:

    1. in daz studio load G8F then apply eyes.duf
    2. in blender import G8F with face units then import action eyes.duf

  5. Alessandro Padovani reporter

    update. important. possible fix ?

    It seems that if we set the slider limits to none and the final limits to daz then the animation works fine. So this is probably what we must use as default, other settings produce different animations compared to daz studio.

    Unless you want to override the global settings when loading daz animations. Let us know.

  6. Alessandro Padovani reporter

    update. important. better fix.

    In python we can set soft and hard limits for sliders. It seems the actual implementation sets the hard limits, thus not allowing daz keyframes to go outside. The slider limits in the global settings should only set the soft limits, leaving the hard limits to none, this way users will have the wanted limits in the UI, while daz animations can go outside.

    Same when we “update slider limits“ in advanced setup, it should only change the soft limits for sliders.

    Let us know.

    https://docs.blender.org/api/current/bpy.props.html

  7. Thomas Larsson repo owner

    Implemented in last commit. Now the sliders have soft limits. The final properties still have hard limits, which correspond to the limits in DS.

  8. Alessandro Padovani reporter

    Commit 3e1e0dc works fine, thank you.

    The broken ERCs still there in daz studio, so they don’t work. But it seems at least we can reproduce the same behavior in blender, so daz animations work fine. Closing as resolved.

  9. Alessandro Padovani reporter

    4.2.1.2270, blender 4.2.0

    update. possible solution.

    As reported in #2143 #2168 there are issues.

    #2143 The soft limits don't work for props.

    #2168 Adjusters can't go outside the daz limits, unless we use the multiplier.

    A possible solution is to set the multiplier = 10, that's the same as the blender maximum for shapekeys, and similar to final limits = none, apart that the multiplier works fine with daz poses, as verified above. This way the adjusters can go up to 10x the final limits, as well as the sliders.

    One drawback is that this way the sliders soft limits are affected by the multiplier too, which we don't want as now the multiplier is used for the final limits. So we can introduce a new property for the soft limits.

    # fix for adjusters
    set final multiplier = 10, this is the old multiplier
    set slider multiplier = 1 or as desired, this is the new multiplier for soft limits
    for each slider
        slider soft limits = slider limits * slider multiplier
        # this will also fix #2143
    

    Note that this fix doesn't change anything on the actual code or behavior, so users can continue using their favorite settings as before. It only introduces a new "slider multiplier", that is to be set the same as the "final multiplier" to get the old behavior, or used for soft limits.

    # new settings usage
    
    # this is the same as the old settings without soft limits
    slider multiplier = final multiplier
    
    # this is the new soft limits wich also fixes #2143 #2168
    # should be the new default values
    final limits = daz
    slider limits = daz
    final multiplier = 10 # this is the old multiplier
    slider multiplier = 1 or as desired, for extra soft limits
    

    note. If we want, we could remove all settings and only keep the adjusters and slider multiplier, which will work fine in general. This simplifies things a lot, but this way users can't have the old settings anymore.

    Let me know what you think. Or if something is not clear.

  10. Thomas Larsson repo owner

    Sorry, but I don’t understand. Should it be possible to change the slider multiplier dynamically? If so the soft limits will not be updated, because it is not possible to add drivers to the soft limits (nor to the hard limits for that matter). If both the slider limits and the multiplier are static values that are set when the morphs is loaded, then I don’t see the point with having a multiplier.

  11. Alessandro Padovani reporter

    Yes the soft limits are static. The point is the multiplier we use now affects the final limits, so we need a separate multiplier for the soft limits, because final limits and soft limits are different.

    The "final multiplier" is the same as the actual multiplier, nothing changes.

    The "slider multiplier" is used to compute and assign the soft limits when the slider is created, it is a static value only computed once. Actually it is used the "final multiplier" to compute and assign soft limits.

  12. Alessandro Padovani reporter

    update. Commit 82129cf.

    To explain it better. Setting the multiplier = 10 allows the adjusters to work outside the daz limits, but this also affects the sliders soft limits. So we need separate multipliers for the adjusters and the sliders.

    steps (as it is now):

    1. in the global settings set multiplier = 10
    2. import G8 with expressions and adjusters
    3. check the adjusters, they work fine up to 10
    4. check the sliders, they work fine up to 10 with soft limits

    If we add "final multiplier" and "slider multiplier", then we can use the "slider multiplier" for the soft limits.

    steps (after the fix):

    1. in the global settings set final multiplier = 10 and slider multiplier = 2
    2. import G8 with expressions and adjusters
    3. check the adjusters, they work fine up to 10
    4. check the sliders, they work fine up to 2 with soft limits

    note. Setting the final limits = none is not the same thing, as this way the test animation eyes.duf doesn't work fine, while it works fine with limits = daz and multiplier = 10.

  13. Thomas Larsson repo owner

    I think I have implemented what you requested. I’m still not sure that adjusters are a good idea, but if they are here they might at least work.

  14. Alessandro Padovani reporter

    Commit 56739f0.

    Thank you for your work. I myself don’t use adjusters either, I only use the multiplier which works fine. This is just an idea to help getting adjusters to work. The last commit gets the idea but it doesn’t seem to work fine. If I set the slider to 2 I get a good result, if I set the adjuster to 2 it somewhat explodes so I guess the factors are not computed right.

    steps:

    1. set final multiplier = 10 and slider multiplier = 2
    2. import G8 with expressions and adjusters
    3. set the slider = 2, it works fine
    4. set the slider = 1 and the adjuster = 2, it “explodes”
    5. same for “adjust morph strength“

  15. Alessandro Padovani reporter

    update. It seems the bug above only happens with HD morphs, if I “ignore HD morphs“ then it works fine.

  16. Alessandro Padovani reporter

    update. Indeed the HD shapekey is driven to 4 instead of 2, so it seems something is counted double.

  17. Alessandro Padovani reporter

    p.s. I see commit 56739f0 doesn’t get the float sliders to drive the prop shapekeys as suggested in #2143. That is complementary to this fix for soft limits and multipliers, so they can work with props too.

  18. Alessandro Padovani reporter

    note. default values.

    The default for the final multiplier should be 10, otherwise adjusters can’t work should the user enable them. I’d also add some more description to the tooltips to make this clear. Though of course I plan to update the wiki once this works so it will be also explained there.

    slider multiplier:

    • default: 1
    • tooltip: “Multiply the daz limits for sliders, only soft limits are affected, the sliders have no hard limits.“

    final multiplier:

    • default: 10
    • tooltip: “Multiply the daz limits for adjusters, this is required to allow adjusters to go outside the daz limits.“

  19. Log in to comment