Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Curve mapper": respect "use clipping" option. #4864

Merged
merged 4 commits into from
Jan 8, 2023
Merged

Conversation

portnov
Copy link
Collaborator

@portnov portnov commented Jan 8, 2023

Earlier we used
https://docs.blender.org/api/current/bpy.types.CurveMapping.html#bpy.types.CurveMapping.evaluate method to calculate the resulting value of mapper, in hope that it respects clipping settings automatically. However, it appears to do not. As a result, if the curve goes, for example, beyond [0;1] by Y, the result of the curve mapper could go negative even though "use clipping" option in the curve widget is enabled.

This change adds explicit clipping to evaluate function. If someone happened to adapt previous behaviour, they can just untick the "use clipping" checkbox in the curve widget settings.

Clipping enabled:
Screenshot_20230108_204211

the same curve with disabled clipping:
Screenshot_20230108_204144

Preflight checklist

Put an x letter in each brackets when you're done this item:

  • Code changes complete.
  • Code documentation complete.
  • Documentation for users complete (or not required, if user never sees these changes).
  • Manual testing done.
  • Unit-tests implemented.
  • Ready for merge.

Earlier we used
https://docs.blender.org/api/current/bpy.types.CurveMapping.html#bpy.types.CurveMapping.evaluate
method to calculate the resulting value of mapper, in hope that it
respects clipping settings automatically. However, it appears to do not.
As a result, if the curve goes, for example, beyond [0;1] by Y, the
result of the curve mapper could go negative even though "use clipping"
option in the curve widget is enabled.

This change adds explicit clipping to evaluate function. If someone
happened to adapt previous behaviour, they can just untick the "use
clipping" checkbox in the curve widget settings.
@portnov portnov merged commit 7f9602f into master Jan 8, 2023
@portnov portnov deleted the curve_mapper_clipping branch January 8, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant