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

mypaint_mapping_is_constant() doesn't catch inert input mappings #100

Open
briend opened this issue Jul 16, 2017 · 1 comment
Open

mypaint_mapping_is_constant() doesn't catch inert input mappings #100

briend opened this issue Jul 16, 2017 · 1 comment
Labels

Comments

@briend
Copy link
Contributor

briend commented Jul 16, 2017

mypaint_mapping_is_constant() is supposed to be a way to check that an input has any dynamic inputs defined, however MyPaint seems to leave extra settings that are effectively disabled, like:

            "random": [
                [
                    0.0, 
                    0.0
                ], 
                [
                    1.0, 
                    0.0
                ]
            ]

So not only the does it seem to try to interpolate this (see #99 ), but mypaint_mapping_is_constant will return false if you've ever added an input and then erased it. SO, this can be a huge performance penalty because smudge gets turned on:

mypaint-brush.c:785
// update smudge color
if (self->settings_value[MYPAINT_BRUSH_SETTING_SMUDGE_LENGTH] < 1.0 &&
// optimization, since normal brushes have smudge_length == 0.5 without actually smudging
(self->settings_value[MYPAINT_BRUSH_SETTING_SMUDGE] != 0.0 || !mypaint_mapping_is_constant(self->settings[MYPAINT_BRUSH_SETTING_SMUDGE])))

So basically a lot of brushes might call get_color even when they shouldn't, unless you 1) manually delete any inputs for the Smudge setting from your brush files, or 2) set Smudge_Length to 1.0. Ack!!

@briend briend added the bug label Jul 16, 2017
@briend briend changed the title mypaint_mapping_is_constant doesn't catch bogus input mappings mypaint_mapping_is_constant doesn't catch inert input mappings Jul 16, 2017
achadwick added a commit to mypaint/mypaint that referenced this issue Jul 16, 2017
When the brush dynamics are reset for a given input in the editor UI,
the graph was reset to some spurious zero entries. This was the cause
of some annoying knock-on effects in the brush engine, and since the
meaning of "reset" is kinda obvious, we should probably do the least
surprising thing.

Note that setting the dynamic's ±y slider to *exactly* zero does the
same graph reset (but see #826 for a discussion of
whether that's a good idea or not)

Closes #840.
Addresses mypaint/libmypaint#99 and mypaint/libmypaint#100. Sorta.
@briend briend changed the title mypaint_mapping_is_constant doesn't catch inert input mappings mypaint_mapping_is_constant() doesn't catch inert input mappings Jul 20, 2017
@briend
Copy link
Contributor Author

briend commented Jul 26, 2017

Even though mypaint/mypaint#840 is closed I think we need to do something in the engine, since a lot of brushes will contain these bogus mappings forever. Is there an easy way to evaluate if a set of points is "inert" and can be ignored entirely?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant