Skip to content

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

@briend

Description

@briend

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!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    type.BugSomething isn't working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions