Skip to content

Modding funscript-utils #12

@scruffynerf

Description

@scruffynerf

you're pulling in funscript-utils which is doing the mapping... and the key bit of duration mapping is this:

const msToX = width / script.actions.slice(-1)[0].at;

Any idea if we have the scene duration handy in the js? I'd love to make the same option for the map that is displayed when a dropdown choice is made as is done in the multimap (ie either map the entire script OR map against the scene duration)

Dunno how many other people have mismatched scripts but I've got a bunch I'm trying to decide what's the 'good ones' (or at least match my videos) and the ability to map against the scene length is so critical (if you have scene sprites, it even moves along the script as it plays... which doesn't happen if the script is at all different length from scene.

Ideally, this would be an option on that panel, allowing user to decide which to map against.

Looking at the code and inspecting it in use... we have the scripts array as a list of scripts
with label and path... we could just pass in the script duration (last action in ms) and scene duration (which we have in Stash), and then deciding which to use is just a matter of forking the mapping code and using. custom routine that has a check for which method to use (literally just change what we divide the width by, either the entire script or just the scene length time.). The advantage to passing both is that you could make the dropdown SAY the length of the script next to the label (ie Default: 35:00. Alt: 34:45 etc)

FunMapper.renderHeatmap(canvas, script, {
background: 'rgba(255,255, 255, 0)',
});

to something more like
StashInteractiveFunMapper.renderHeatmap(canvas, script, lengthtouse, {
background: 'rgba(255,255, 255, 0)',
});
(where lengthtouse would either be the scene duration in seconds (or milliseconds) or 0 (in which case, behave as it is now, reading the last action time.)

Actually wouldn't even need to fork it, just copy the functionality and make the above function a wrapper that either uses the scene duration and maps, or calls the original function if 0...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions