Custom Liquify transformation through Batch Play / UXP

Hi,

I’m really struggling to find the solution on how to invoke the liquify transformation like Eye size, smile etc. through Batchplay.

Alchemist’s listener doesn’t record anything helpful.

This is how I want to use it in my plugin:

I was able to do this in CEP without issues by using script listener:


function eyeplus() {
    // Liquify
    function step1(enabled, withDialog) {
        if (enabled != undefined && !enabled)
            return;
        var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
        var desc1 = new ActionDescriptor();
        var _hexToBin =
            function(h) {
                function binMap(n) {
                    if (n.match(/[0-9]/)) return parseInt(n);
                    return parseInt((n.charCodeAt(0) - 'A'.charCodeAt(0)) + 10);
                }

                h = h.toUpperCase().replace(/\s/g, '');
                var bytes = '';

                for (var i = 0; i < h.length / 2; i++) {
                    var hi = h.charAt(i * 2);
                    var lo = h.charAt(i * 2 + 1);
                    var b = (binMap(hi) << 4) + binMap(lo);
                    bytes += String.fromCharCode(b);
                }
                return bytes;
            };
        desc1.putData(cTID('LqMe'), _hexToBin("000000047966714C6873654D02000000A60400007C0300000000000001000000" +
            "0000000000000000F20D0000981200000000000000000000F20D000098120000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000A6040000A6040000A6040000A6040000" +
            "A6040000A6040000A6040000A6040000656361463D0200000000000000000010" +
            "00000001000000000008666163654D6573680000000300000015666163654465" +
            "7363726970746F7256657273696F6E6C6F6E67000000020000000F666163654D" +
            "65736856657273696F6E6C6F6E67000000020000000C66616365496E666F4C69" +
            "7374566C4C73000000014F626A630000000100000000000866616365496E666F" +
            "000000030000000A6661636543656E7465724F626A6300000001000000000000" +
            "6E756C6C000000020000000058202020646F75623FD83DB385CEF38600000000" +
            "59202020646F75623FD131A7A7A7A7A80000000D6665617475726556616C7565" +
            "734F626A630000000100000000000D6665617475726556616C75657300000009" +
            "0000000765796553697A65646F75623FC99999A0000000000000096579654865" +
            "69676874646F75623FC99999A0000000000000086579655769647468646F7562" +
            "3FC99999A00000000000000B6C65667445796553697A65646F75623FC99999A0" +
            "0000000000000C726967687445796553697A65646F75623FC99999A000000000" +
            "00000D6C656674457965486569676874646F75623FC99999A00000000000000E" +
            "7269676874457965486569676874646F75623FC99999A00000000000000C6C65" +
            "66744579655769647468646F75623FC99999A00000000000000D726967687445" +
            "79655769647468646F75623FC99999A000000000000014666561747572654469" +
            "73706C6163656D656E74734F626A630000000100000000001466656174757265" +
            "446973706C6163656D656E747300000000" +
            ""
        ));
        var _hexToBin =
            function(h) {
                function binMap(n) {
                    if (n.match(/[0-9]/)) return parseInt(n);
                    return parseInt((n.charCodeAt(0) - 'A'.charCodeAt(0)) + 10);
                }

                h = h.toUpperCase().replace(/\s/g, '');
                var bytes = '';

                for (var i = 0; i < h.length / 2; i++) {
                    var hi = h.charAt(i * 2);
                    var lo = h.charAt(i * 2 + 1);
                    var b = (binMap(hi) << 4) + binMap(lo);
                    bytes += String.fromCharCode(b);
                }
                return bytes;
            };
        desc1.putData(sTID("faceMeshData"), _hexToBin("0000001000000001000000000008666163654D65736800000003000000156661" +
            "636544657363726970746F7256657273696F6E6C6F6E67000000020000000F66" +
            "6163654D65736856657273696F6E6C6F6E67000000020000000C66616365496E" +
            "666F4C697374566C4C73000000014F626A630000000100000000000866616365" +
            "496E666F000000030000000A6661636543656E7465724F626A63000000010000" +
            "000000006E756C6C000000020000000058202020646F75623FD83DB385CEF386" +
            "0000000059202020646F75623FD131A7A7A7A7A80000000D6665617475726556" +
            "616C7565734F626A630000000100000000000D6665617475726556616C756573" +
            "000000090000000765796553697A65646F75623FC99999A00000000000000965" +
            "7965486569676874646F75623FC99999A0000000000000086579655769647468" +
            "646F75623FC99999A00000000000000B6C65667445796553697A65646F75623F" +
            "C99999A00000000000000C726967687445796553697A65646F75623FC99999A0" +
            "0000000000000D6C656674457965486569676874646F75623FC99999A0000000" +
            "0000000E7269676874457965486569676874646F75623FC99999A00000000000" +
            "000C6C6566744579655769647468646F75623FC99999A00000000000000D7269" +
            "6768744579655769647468646F75623FC99999A0000000000000146665617475" +
            "7265446973706C6163656D656E74734F626A6300000001000000000014666561" +
            "74757265446973706C6163656D656E747300000000" +
            ""
        ));
        executeAction(1282492025, desc1, dialogMode);
    };

    step1(); // Liquify
};

I would really appreciate your help!

It is similar in UXP but instead of rawData type you have base64 for setting and ArrayBuffer for reading. In Alchemist you should check additional settings that are turned of by default for performance reasons. RawData can have megabytes. Also, ArrayBuffer is not exactly JSON friendly :smiley:

Hi,

I’ve tried to change the settings as shown below but still no luck. That’s all I’m getting:




Could you please try this with lookup tables? There should be also Raw data type and I know that it worked.

Maybe it’s a dumb question but what are lookup tables?

Could you please explain what exactly should I do?

It is the color adjustment that applies to the layer.

[IGNORE THIS] I couldn’t record anything through Alchemist:

It works for Color Lookup

Yes, it should look exactly like this. So raw data type works but not for liquify?

Exactly, I couldn’t make it work for liquify. Maybe you have another idea

Pozdrawiam

Adam

You could try to record it as an action and then convert action via Occultist. If you can’t record it then check “allow tool recording” in the action panel menu. Or try ScriptListener or older version of Photoshop or vanilla event listener in UXP which is the core of Alchemist.

2 Likes

It works through Action recording and Occultist, thank you!

1 Like