Skip to main content
Participant
April 26, 2020
Question

Scripting Liquify

  • April 26, 2020
  • 2 replies
  • 1999 views

I am attempting to write a javascript script following the steps on pg 75 and 76 of the Adobe Scripting Guide. I recorded a macro and used the liquify tool for making facial adjustments but instead of having a log that outputted the parameter fields of the liquify tool, I was provided with two variables "idLqMe" and "faceMeshData" both in which have Char Encodings as their input. Does anyone know how I would go about trying to create this Char encoding for the set parameters or decoding it?

 

 

var idLqFy = charIDToTypeID( "LqFy" );
    var desc11 = new ActionDescriptor();
    var idLqMe = charIDToTypeID( "LqMe" );
    desc11.putData( idLqMe, String.fromCharCode( 0, 0, 0, 4, 121, 102, 113, 76, 104, 115, 101, 77, 2, 0, 0, 0, 144, 1, 0, 0, 18, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 
0, 0, 0, 0, 0, 0, 0, 0, 72, 4, 0, 0, 64, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 72, 4, 0, 0, 64, 6, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 144, 1, 0, 0, 
144, 1, 0, 0, 144, 1, 0, 0, 101, 99, 97, 70, 129, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 0, 
0, 8, 102, 97, 99, 101, 77, 101, 115, 104, 0, 0, 0, 3, 0, 0, 0, 21, 102, 97, 99, 101, 68, 101, 115, 99, 114, 105, 112, 116, 111, 114, 
86, 101, 114, 115, 105, 111, 110, 108, 111, 110, 103, 0, 0, 0, 2, 0, 0, 0, 15, 102, 97, 99, 101, 77, 101, 115, 104, 86, 101, 114, 115, 105, 
111, 110, 108, 111, 110, 103, 0, 0, 0, 2, 0, 0, 0, 12, 102, 97, 99, 101, 73, 110, 102, 111, 76, 105, 115, 116, 86, 108, 76, 115, 0, 0, 
0, 1, 79, 98, 106, 99, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 102, 97, 99, 101, 73, 110, 102, 111, 0, 0, 0, 3, 0, 0, 0, 10, 
102, 97, 99, 101, 67, 101, 110, 116, 101, 114, 79, 98, 106, 99, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 110, 117, 108, 108, 0, 0, 0, 2, 
0, 0, 0, 0, 88, 32, 32, 32, 100, 111, 117, 98, 63, 226, 242, 204, 0, 0, 0, 0, 0, 0, 0, 0, 89, 32, 32, 32, 100, 111, 117, 98, 
63, 213, 113, 61, 80, 89, 177, 133, 0, 0, 0, 13, 102, 101, 97, 116, 117, 114, 101, 86, 97, 108, 117, 101, 115, 79, 98, 106, 99, 0, 0, 0, 
1, 0, 0, 0, 0, 0, 13, 102, 101, 97, 116, 117, 114, 101, 86, 97, 108, 117, 101, 115, 0, 0, 0, 2, 0, 0, 0, 11, 108, 101, 102, 116, 
69, 121, 101, 83, 105, 122, 101, 100, 111, 117, 98, 191, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 114, 105, 103, 104, 116, 69, 121, 101, 83, 
105, 122, 101, 100, 111, 117, 98, 63, 192, 163, 215, 0, 0, 0, 0, 0, 0, 0, 20, 102, 101, 97, 116, 117, 114, 101, 68, 105, 115, 112, 108, 97, 
99, 101, 109, 101, 110, 116, 115, 79, 98, 106, 99, 0, 0, 0, 1, 0, 0, 0, 0, 0, 20, 102, 101, 97, 116, 117, 114, 101, 68, 105, 115, 112, 
108, 97, 99, 101, 109, 101, 110, 116, 115, 0, 0, 0, 0 ) );
    var idfaceMeshData = stringIDToTypeID( "faceMeshData" );
    desc11.putData( idfaceMeshData, String.fromCharCode( 0, 0, 0, 16, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 102, 97, 99, 101, 77, 101, 115, 104, 0, 0, 0, 3, 0, 0, 0, 21, 102, 97, 
99, 101, 68, 101, 115, 99, 114, 105, 112, 116, 111, 114, 86, 101, 114, 115, 105, 111, 110, 108, 111, 110, 103, 0, 0, 0, 2, 0, 0, 0, 15, 102, 
97, 99, 101, 77, 101, 115, 104, 86, 101, 114, 115, 105, 111, 110, 108, 111, 110, 103, 0, 0, 0, 2, 0, 0, 0, 12, 102, 97, 99, 101, 73, 110, 
102, 111, 76, 105, 115, 116, 86, 108, 76, 115, 0, 0, 0, 1, 79, 98, 106, 99, 0, 0, 0, 1, 0, 0, 0, 0, 0, 8, 102, 97, 99, 101, 
73, 110, 102, 111, 0, 0, 0, 3, 0, 0, 0, 10, 102, 97, 99, 101, 67, 101, 110, 116, 101, 114, 79, 98, 106, 99, 0, 0, 0, 1, 0, 0, 
0, 0, 0, 0, 110, 117, 108, 108, 0, 0, 0, 2, 0, 0, 0, 0, 88, 32, 32, 32, 100, 111, 117, 98, 63, 226, 242, 204, 0, 0, 0, 0, 
0, 0, 0, 0, 89, 32, 32, 32, 100, 111, 117, 98, 63, 213, 113, 61, 80, 89, 177, 133, 0, 0, 0, 13, 102, 101, 97, 116, 117, 114, 101, 86, 
97, 108, 117, 101, 115, 79, 98, 106, 99, 0, 0, 0, 1, 0, 0, 0, 0, 0, 13, 102, 101, 97, 116, 117, 114, 101, 86, 97, 108, 117, 101, 115, 
0, 0, 0, 2, 0, 0, 0, 11, 108, 101, 102, 116, 69, 121, 101, 83, 105, 122, 101, 100, 111, 117, 98, 191, 240, 0, 0, 0, 0, 0, 0, 0, 
0, 0, 12, 114, 105, 103, 104, 116, 69, 121, 101, 83, 105, 122, 101, 100, 111, 117, 98, 63, 192, 163, 215, 0, 0, 0, 0, 0, 0, 0, 20, 102, 
101, 97, 116, 117, 114, 101, 68, 105, 115, 112, 108, 97, 99, 101, 109, 101, 110, 116, 115, 79, 98, 106, 99, 0, 0, 0, 1, 0, 0, 0, 0, 0, 
20, 102, 101, 97, 116, 117, 114, 101, 68, 105, 115, 112, 108, 97, 99, 101, 109, 101, 110, 116, 115, 0, 0, 0, 0 ) );
executeAction( idLqFy, desc11, DialogModes.NO );

 

 

[Moved from Cording Corner to Photoshop by Moderator.]

 

This topic has been closed for replies.

2 replies

Legend
May 11, 2020

LqMe is a transformation mesh that is obtained when working with tools, it depends on the size of the image. faceMeshData - parametric mesh, does not depend on image size, is responsible for the transformation of faces.
The code in your example just loads these two pre-formed meshes.

 

Iteratively changing the parameters of face deformation in liquify window and comparing the new faceMeshData with the previous one, you can find the location of the blocks responsible for each control. But i have not seen examples of someone parsing the binary code of a mesh.

JJMack
Community Expert
Community Expert
May 11, 2020

I would think that you would want you use liquify on each document differently depending on the documents size, resolution and content.  What kind of process are you scripting? Even the same faces would  have a different perspective in each image. What kind of AI are your trying to script. Its doomed to be slow. Will liquify even detect but a single face in each of your document you will processed?

JJMack