How to get deformation info for a Custom Warp

With this batchplay action, I can get all document data in JSON File

let result = await batchPlay(
          [{
            _obj: "get",
            _target: [
                {
                  _property: "json"
                },
                {
                  _ref: "document",
                  _id: this._id,
                },
            ],
            expandSmartObjects: true,
            getTextStyles: true,
            getFullTextStyles: true,
            getDefaultLayerFX: true,
            layerID: 0,
            getCompLayerSettings: true,
            getPathData: true,
            imageInfo: true,
            compInfo: true,
            layerInfo: true,
            includeAncestors: true,
          }],{})
        resolve(result)

After obtain JSON file, I need info of a custom warp in Smart object, all I get of this info is:

"quiltWarp": {
                    "warpStyle": "warpCustom",
                    "warpValue": 0,
                    "warpPerspective": 0,
                    "warpPerspectiveOther": 0,
                    "warpRotate": "horizontal",
                    "bounds": {
                        "top": 0,
                        "left": 0,
                        "bottom": 5000,
                        "right": 3333
                    },
                    "uOrder": 4,
                    "vOrder": 4,
                    "deformNumRows": 16,
                    "deformNumCols": 16
                },

Is there any way to get all matrix or all info of this warp in Smart Objects like a next image

Appreciate your help with this.

I think you want this

const {executeAsModal} = require("photoshop").core;
const {batchPlay} = require("photoshop").action;

async function actionCommands() {
   const result = await batchPlay(
      [
         {
            _obj: "get",
            _target: [
               {
                  _ref: "layer",
                  _id: 5 // change this ID
               },
               {
                  _ref: "document",
                  _id: 81 // change this ID
               }
            ],
            _options: {
               dialogOptions: "dontDisplay"
            }
         }
      ],
      {}
   );
   
   const data = result["0"].smartObjectMore.quiltWarp.customEnvelopeWarp;
}

async function runModalFunction() {
   await executeAsModal(actionCommands, {"commandName": "Action Commands"});
}

await runModalFunction();

4 Likes

I think this might work for me. Thank you so much !!