Not sure if it’s the only way, but you can get this from layers json
property.
{
_obj: "get",
_target: [
{_property: "json"},
{ _ref: "layer",_enum: "ordinal", _value: "targetEnum"},
],
_options: {dialogOptions: "dontDisplay"}
}
There you’ll need to JSON.parse(propertyValue)
and you’ll find layers
. Then you could recursively iterate through these layers and find the one you need by ID. You’ll get something like that:
{
"id": 18,
"index": 4,
"type": "adjustmentLayer",
"name": "Curves 1",
"bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
"visible": true,
"clipped": false,
"adjustment": {
"presetKind": "presetKindCustom",
"adjustment": [
{
"channel": "composite",
"curve": [
{"horizontal": 0, "vertical": 0},
{"horizontal": 147, "vertical": 106},
{"horizontal": 219, "vertical": 136},
{"horizontal": 255, "vertical": 255}
]
}
],
"class": "curves"
},
"mask": {
"bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
"extendWithWhite": true
},
"generatorSettings": false
}
Just checked and even if you reset all points on the curve, it still gives custom
, but without adjustment
:
{
"id": 18,
"index": 4,
"type": "adjustmentLayer",
"name": "Curves 1",
"bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
"visible": true,
"clipped": false,
"adjustment": {
"presetKind": "presetKindCustom",
"class": "curves"
},
"mask": {
"bounds": {"top": 0, "left": 0, "bottom": 2048, "right": 3072},
"extendWithWhite": true
},
"generatorSettings": false
}
Freshly created layer has exact same structure, but "presetKind": "presetKindDefault"