c4d.utils.RangeMap clampval funkyness



  • Hi,

    I found this behavior rather puzzling, you might want to clarify the effect of clampval in the docs if you deem this behavior correct or alternatively make it clearer, that the function is not intended to be used with inverted output intervals.

    >>> # We would expect 0.0
    >>> c4d.utils.RangeMap(.5, 0., 1., -1., 1., False)
    0.0
    >>> # We would expect 0.0
    >>> c4d.utils.RangeMap(.5, 0., 1., -1., 1., True)
    0.0
    >>> # We would expect 0.0
    >>>  c4d.utils.RangeMap(.5, 0., 1., 1., -1., False)
    0.0
    >>> # We would expect 0.0
    >>>  c4d.utils.RangeMap(.5, 0., 1., 1., -1., True)
    1.0
    >>> # Whoops ...
    

    Cheers,
    zipit



  • Hi,

    thanks a lot. I've opened a bug entry for that one. It will be fixed in a futur release.

    Cheers,
    Manuel