editmamei 1.0.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/dist/api/extendscript/_helpers.js +70 -2
- package/dist/api/photoshop-api.js +17 -2
- package/dist/bin/editmamei-core-darwin-arm64 +0 -0
- package/dist/bin/editmamei-core-darwin-x64 +0 -0
- package/dist/bin/editmamei-core-win-x64.exe +0 -0
- package/dist/cli/activate.js +1 -1
- package/dist/cli/config.js +1 -1
- package/dist/cli/deactivate.js +1 -1
- package/dist/core/raw-develop-state.js +13 -0
- package/dist/core/server.js +147 -18
- package/dist/core/tool-groups.js +18 -21
- package/dist/core/tool-tiers.js +7 -10
- package/dist/detection/runtime.js +2 -2
- package/dist/modules/ce/index.js +2 -0
- package/dist/perception/region-scorer.js +1 -1
- package/dist/platform/connection.js +15 -0
- package/dist/skills/editmamei-skill.zip +0 -0
- package/dist/telemetry/client.js +15 -2
- package/dist/telemetry/sanitize.js +1 -0
- package/dist/tools/adjustment-tools.js +21 -3
- package/dist/tools/detection-tools.js +1 -1
- package/dist/tools/document-tools.js +5 -2
- package/dist/tools/filter-tools.js +118 -15
- package/dist/tools/group-tools.js +146 -146
- package/dist/tools/history-tools.js +1 -1
- package/dist/tools/inspect-tools.js +22 -3
- package/dist/tools/layer-tools.js +4 -27
- package/dist/tools/overview-tools.js +37 -8
- package/dist/tools/preview-tools.js +3 -2
- package/dist/tools/scene-tools.js +1 -1
- package/dist/tools/selection-tools.js +91 -18
- package/dist/tools/sky-tools.js +126 -0
- package/dist/tools/smart-object-tools.js +163 -0
- package/dist/tools/text-tools.js +62 -41
- package/dist/update/check.js +65 -6
- package/dist/update/session-fixes.js +33 -0
- package/dist/utils/jsx.js +2 -1
- package/dist/utils/operation-timeouts.js +2 -0
- package/dist/utils/session-log.js +46 -6
- package/dist/utils/temp.js +1 -1
- package/dist/utils/tool-helpers.js +23 -0
- package/dist/version.js +1 -1
- package/package.json +13 -2
|
@@ -2,7 +2,9 @@ import { runScript } from '../utils/run-script.js';
|
|
|
2
2
|
import { validateArgs } from '../utils/validate.js';
|
|
3
3
|
import { OnnxLandmarkDetectionClient } from '../detection/landmark-detection-client.js';
|
|
4
4
|
import { resolveGatedPlacement, PLACEMENT_SCHEMA } from '../perception/grounding-locate.js';
|
|
5
|
-
import { toolErrorResult, runSnippetTool, applyToActiveLayerProp } from '../utils/tool-helpers.js';
|
|
5
|
+
import { toolErrorResult, runSnippetTool, applyToActiveLayerProp, asSmartFilterProp, unknownDiscriminator, } from '../utils/tool-helpers.js';
|
|
6
|
+
import { LAYER_BLEND_MODES } from '../utils/blend-modes.js';
|
|
7
|
+
import { runSmartFilterOp } from './smart-object-tools.js';
|
|
6
8
|
const gaussianBlurSchema = {
|
|
7
9
|
type: 'object',
|
|
8
10
|
properties: {
|
|
@@ -13,6 +15,7 @@ const gaussianBlurSchema = {
|
|
|
13
15
|
maximum: 250,
|
|
14
16
|
},
|
|
15
17
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
18
|
+
as_smart_filter: asSmartFilterProp(),
|
|
16
19
|
},
|
|
17
20
|
required: ['radius'],
|
|
18
21
|
};
|
|
@@ -39,6 +42,7 @@ const sharpenSchema = {
|
|
|
39
42
|
default: 0,
|
|
40
43
|
},
|
|
41
44
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
45
|
+
as_smart_filter: asSmartFilterProp(),
|
|
42
46
|
},
|
|
43
47
|
required: ['amount', 'radius'],
|
|
44
48
|
};
|
|
@@ -63,6 +67,7 @@ const noiseSchema = {
|
|
|
63
67
|
default: false,
|
|
64
68
|
},
|
|
65
69
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
70
|
+
as_smart_filter: asSmartFilterProp(),
|
|
66
71
|
},
|
|
67
72
|
required: ['amount'],
|
|
68
73
|
};
|
|
@@ -82,6 +87,7 @@ const motionBlurSchema = {
|
|
|
82
87
|
maximum: 999,
|
|
83
88
|
},
|
|
84
89
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
90
|
+
as_smart_filter: asSmartFilterProp(),
|
|
85
91
|
},
|
|
86
92
|
required: ['angle', 'radius'],
|
|
87
93
|
};
|
|
@@ -166,6 +172,7 @@ const lensBlurSchema = {
|
|
|
166
172
|
default: false,
|
|
167
173
|
},
|
|
168
174
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
175
|
+
as_smart_filter: asSmartFilterProp(),
|
|
169
176
|
},
|
|
170
177
|
};
|
|
171
178
|
const smartSharpenSchema = {
|
|
@@ -248,6 +255,7 @@ const smartSharpenSchema = {
|
|
|
248
255
|
default: 30,
|
|
249
256
|
},
|
|
250
257
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
258
|
+
as_smart_filter: asSmartFilterProp(),
|
|
251
259
|
},
|
|
252
260
|
};
|
|
253
261
|
const reduceNoiseSchema = {
|
|
@@ -334,6 +342,7 @@ const reduceNoiseSchema = {
|
|
|
334
342
|
default: 50,
|
|
335
343
|
},
|
|
336
344
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
345
|
+
as_smart_filter: asSmartFilterProp(),
|
|
337
346
|
},
|
|
338
347
|
};
|
|
339
348
|
const highPassSchema = {
|
|
@@ -347,6 +356,7 @@ const highPassSchema = {
|
|
|
347
356
|
default: 10,
|
|
348
357
|
},
|
|
349
358
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
359
|
+
as_smart_filter: asSmartFilterProp(),
|
|
350
360
|
},
|
|
351
361
|
required: ['radius'],
|
|
352
362
|
};
|
|
@@ -391,6 +401,7 @@ const radialBlurSchema = {
|
|
|
391
401
|
description: 'Grounded alternative to center_x/center_y: NAME the blur center (a `placement` resolving to a POINT — an object centroid, an extremum, a grid intersection). The resolved document-pixel point is normalized to the 0-1 center for you and WINS over center_x/center_y. The blur runs ONLY if the objective gate PASSES.',
|
|
392
402
|
},
|
|
393
403
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
404
|
+
as_smart_filter: asSmartFilterProp(),
|
|
394
405
|
},
|
|
395
406
|
};
|
|
396
407
|
const pixelateSchema = {
|
|
@@ -444,6 +455,7 @@ const pixelateSchema = {
|
|
|
444
455
|
default: 10,
|
|
445
456
|
},
|
|
446
457
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
458
|
+
as_smart_filter: asSmartFilterProp(),
|
|
447
459
|
},
|
|
448
460
|
required: ['mode'],
|
|
449
461
|
};
|
|
@@ -556,6 +568,7 @@ const distortSchema = {
|
|
|
556
568
|
default: 12345,
|
|
557
569
|
},
|
|
558
570
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
571
|
+
as_smart_filter: asSmartFilterProp(),
|
|
559
572
|
},
|
|
560
573
|
required: ['mode'],
|
|
561
574
|
};
|
|
@@ -628,6 +641,7 @@ const stylizeSchema = {
|
|
|
628
641
|
default: 10,
|
|
629
642
|
},
|
|
630
643
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
644
|
+
as_smart_filter: asSmartFilterProp(),
|
|
631
645
|
},
|
|
632
646
|
required: ['mode'],
|
|
633
647
|
};
|
|
@@ -660,6 +674,7 @@ const renderSchema = {
|
|
|
660
674
|
default: 12345,
|
|
661
675
|
},
|
|
662
676
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
677
|
+
as_smart_filter: asSmartFilterProp(),
|
|
663
678
|
},
|
|
664
679
|
required: ['mode'],
|
|
665
680
|
};
|
|
@@ -695,6 +710,7 @@ const otherSchema = {
|
|
|
695
710
|
default: 0,
|
|
696
711
|
},
|
|
697
712
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
713
|
+
as_smart_filter: asSmartFilterProp(),
|
|
698
714
|
},
|
|
699
715
|
required: ['mode'],
|
|
700
716
|
};
|
|
@@ -721,6 +737,7 @@ const denoiseSchema = {
|
|
|
721
737
|
default: 10,
|
|
722
738
|
},
|
|
723
739
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
740
|
+
as_smart_filter: asSmartFilterProp(),
|
|
724
741
|
},
|
|
725
742
|
required: ['mode'],
|
|
726
743
|
};
|
|
@@ -747,6 +764,7 @@ const blurAdvSchema = {
|
|
|
747
764
|
default: 20,
|
|
748
765
|
},
|
|
749
766
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
767
|
+
as_smart_filter: asSmartFilterProp(),
|
|
750
768
|
},
|
|
751
769
|
required: ['mode'],
|
|
752
770
|
};
|
|
@@ -801,6 +819,7 @@ const oilPaintSchema = {
|
|
|
801
819
|
default: true,
|
|
802
820
|
},
|
|
803
821
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
822
|
+
as_smart_filter: asSmartFilterProp(),
|
|
804
823
|
},
|
|
805
824
|
};
|
|
806
825
|
const displaceSchema = {
|
|
@@ -837,6 +856,7 @@ const displaceSchema = {
|
|
|
837
856
|
default: 'repeat_edge',
|
|
838
857
|
},
|
|
839
858
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
859
|
+
as_smart_filter: asSmartFilterProp(),
|
|
840
860
|
},
|
|
841
861
|
required: ['map_path'],
|
|
842
862
|
};
|
|
@@ -848,6 +868,22 @@ const FILTER_OUTPUT_SCHEMA = {
|
|
|
848
868
|
target_was_copy: { type: 'boolean' },
|
|
849
869
|
target_layer_name: { type: 'string' },
|
|
850
870
|
original_layer_name: { type: 'string' },
|
|
871
|
+
is_smart_object: { type: 'boolean' },
|
|
872
|
+
count: { type: 'number' },
|
|
873
|
+
filters: { type: 'array' },
|
|
874
|
+
visibility_set: { type: 'boolean' },
|
|
875
|
+
requested_enabled: { type: 'boolean' },
|
|
876
|
+
enabled: { type: 'boolean' },
|
|
877
|
+
opacity: { type: 'number' },
|
|
878
|
+
blend_mode: { type: 'string' },
|
|
879
|
+
removed: { type: 'boolean' },
|
|
880
|
+
removed_filter_name: { type: 'string' },
|
|
881
|
+
removed_filter_type: { type: 'string' },
|
|
882
|
+
remaining_count: { type: 'number' },
|
|
883
|
+
index: { type: 'number' },
|
|
884
|
+
filter_name: { type: 'string' },
|
|
885
|
+
filter_type: { type: 'string' },
|
|
886
|
+
layer_name: { type: 'string' },
|
|
851
887
|
context: { type: 'object' },
|
|
852
888
|
},
|
|
853
889
|
};
|
|
@@ -871,13 +907,26 @@ const FILTER_TYPES = [
|
|
|
871
907
|
'displace',
|
|
872
908
|
'oil_paint',
|
|
873
909
|
];
|
|
910
|
+
const FILTER_OPS = ['apply', 'list', 'set_visibility', 'set_blend', 'remove'];
|
|
874
911
|
const FILTER_INPUT_SCHEMA = {
|
|
875
912
|
type: 'object',
|
|
876
913
|
properties: {
|
|
914
|
+
op: {
|
|
915
|
+
type: 'string',
|
|
916
|
+
enum: [...FILTER_OPS],
|
|
917
|
+
default: 'apply',
|
|
918
|
+
description: 'apply (default): apply a NEW filter — set `type` (+ its own params). ' +
|
|
919
|
+
'list: read every re-editable Smart Filter on the active Smart Object (index, name, type, enabled, opacity, blend mode). ' +
|
|
920
|
+
'set_visibility: turn one Smart Filter on/off without losing its settings (needs `index` + `enabled`). ' +
|
|
921
|
+
"set_blend: restyle one Smart Filter's `opacity` and/or `blend_mode` (needs `index` + at least one of them). " +
|
|
922
|
+
'remove: delete one Smart Filter from the stack (needs `index`). ' +
|
|
923
|
+
'The four management ops act on the Smart Filter stack that apply as_smart_filter=true creates; indices are ' +
|
|
924
|
+
'1-based and come from op=list, where 1 is the first-applied filter (bottom of the stack).',
|
|
925
|
+
},
|
|
877
926
|
type: {
|
|
878
927
|
type: 'string',
|
|
879
928
|
enum: [...FILTER_TYPES],
|
|
880
|
-
description: 'Which filter to apply. Each type uses its own parameters: ' +
|
|
929
|
+
description: 'Which filter to apply. Required when op=apply (the default); ignored otherwise. Each type uses its own parameters: ' +
|
|
881
930
|
'gaussian_blur(radius); motion_blur(angle, radius); lens_blur(radius, iris_shape, …); ' +
|
|
882
931
|
'radial_blur(amount, method spin|zoom, quality, center_x, center_y); ' +
|
|
883
932
|
'sharpen=Unsharp Mask(amount, radius, threshold); smart_sharpen(amount, radius, remove_mode, …); ' +
|
|
@@ -920,30 +969,65 @@ const FILTER_INPUT_SCHEMA = {
|
|
|
920
969
|
description: 'Angle in degrees. Used by motion_blur (−360–360) and distort/twirl (−999–999).',
|
|
921
970
|
},
|
|
922
971
|
apply_to_active_layer: applyToActiveLayerProp('the filter'),
|
|
972
|
+
as_smart_filter: asSmartFilterProp(),
|
|
973
|
+
index: {
|
|
974
|
+
type: 'integer',
|
|
975
|
+
description: "1-based index of the filter to act on, as reported by op=list. 1 is the FIRST-APPLIED filter (bottom of the Smart Filters stack in the Layers panel). Required for every op except 'list'.",
|
|
976
|
+
minimum: 1,
|
|
977
|
+
maximum: 1000,
|
|
978
|
+
},
|
|
979
|
+
enabled: {
|
|
980
|
+
type: 'boolean',
|
|
981
|
+
description: 'set_visibility only: true shows the filter, false hides it. The filter stays in the stack either way and keeps all its settings.',
|
|
982
|
+
},
|
|
983
|
+
opacity: {
|
|
984
|
+
type: 'number',
|
|
985
|
+
description: 'set_blend only: filter opacity 0-100. Omit to leave the current opacity untouched.',
|
|
986
|
+
minimum: 0,
|
|
987
|
+
maximum: 100,
|
|
988
|
+
},
|
|
989
|
+
blend_mode: {
|
|
990
|
+
type: 'string',
|
|
991
|
+
enum: [...LAYER_BLEND_MODES],
|
|
992
|
+
description: 'set_blend only: how the filter result composites against the unfiltered layer. Same names as ps_set_layer. Omit to leave the current mode untouched.',
|
|
993
|
+
},
|
|
923
994
|
},
|
|
924
|
-
required: ['type'],
|
|
925
995
|
};
|
|
996
|
+
const FILTER_DESCRIPTION = "Apply a Photoshop filter (op=apply, the default) to a DUPLICATE of the active layer by default — the original is preserved, undo by deleting the copy. Pass apply_to_active_layer:true to bake into the original instead. Choose the filter with `type` (see the `type` field for its params); pass as_smart_filter:true on a Smart Object to apply it as a re-editable SMART FILTER instead of rasterizing. This same tool also reads and manages that re-editable Smart Filter stack: op=list (every filter's index/name/type/enabled/opacity/blend), op=set_visibility (toggle one off/on), op=set_blend (restyle opacity/blend_mode), op=remove (delete one). Management ops need a 1-based `index` from op=list first — index 1 is the first-applied filter, at the bottom of the stack. Covers blur, sharpen, noise, high_pass, pixelate, distort, displace, and oil_paint.";
|
|
926
997
|
export function createFilterTools(connection, snippetClient, client = new OnnxLandmarkDetectionClient()) {
|
|
927
998
|
return [
|
|
928
999
|
{
|
|
929
1000
|
tool: {
|
|
930
|
-
name: '
|
|
931
|
-
description:
|
|
1001
|
+
name: 'ps_filter',
|
|
1002
|
+
description: FILTER_DESCRIPTION,
|
|
932
1003
|
inputSchema: FILTER_INPUT_SCHEMA,
|
|
933
1004
|
outputSchema: FILTER_OUTPUT_SCHEMA,
|
|
934
1005
|
annotations: {
|
|
935
|
-
title: '
|
|
1006
|
+
title: 'Filter',
|
|
936
1007
|
destructiveHint: true,
|
|
937
1008
|
idempotentHint: false,
|
|
938
1009
|
},
|
|
939
1010
|
},
|
|
940
|
-
handler: async (args) =>
|
|
1011
|
+
handler: async (args) => runFilterTool(connection, snippetClient, client, args),
|
|
941
1012
|
},
|
|
942
1013
|
];
|
|
943
1014
|
}
|
|
1015
|
+
async function runFilterTool(connection, snippetClient, detClient, rawArgs) {
|
|
1016
|
+
const op = rawArgs.op ?? 'apply';
|
|
1017
|
+
if (op !== 'apply') {
|
|
1018
|
+
if (!FILTER_OPS.includes(op)) {
|
|
1019
|
+
return unknownDiscriminator('filter op', op, FILTER_OPS);
|
|
1020
|
+
}
|
|
1021
|
+
return runSmartFilterOp(connection, snippetClient, rawArgs);
|
|
1022
|
+
}
|
|
1023
|
+
if (rawArgs.type === undefined) {
|
|
1024
|
+
return toolErrorResult('Error in ps_filter', new Error('op=apply needs a `type` (which filter to apply) — see the `type` field for the full list.'));
|
|
1025
|
+
}
|
|
1026
|
+
return applyFilter(connection, snippetClient, detClient, rawArgs);
|
|
1027
|
+
}
|
|
944
1028
|
async function applyFilter(connection, snippetClient, detClient, rawArgs) {
|
|
945
1029
|
const type = rawArgs.type;
|
|
946
|
-
const { type:
|
|
1030
|
+
const { type: _omitType, op: _omitOp, ...rest } = rawArgs;
|
|
947
1031
|
switch (type) {
|
|
948
1032
|
case 'gaussian_blur':
|
|
949
1033
|
return applyGaussianBlur(connection, snippetClient, rest);
|
|
@@ -1004,6 +1088,7 @@ async function applyGaussianBlur(connection, snippetClient, rawArgs) {
|
|
|
1004
1088
|
params: (args) => ({
|
|
1005
1089
|
radius: args.radius,
|
|
1006
1090
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1091
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1007
1092
|
}),
|
|
1008
1093
|
successText: (result, args) => {
|
|
1009
1094
|
const r = result;
|
|
@@ -1027,6 +1112,7 @@ async function applySharpen(connection, snippetClient, rawArgs) {
|
|
|
1027
1112
|
radius: args.radius,
|
|
1028
1113
|
threshold: args.threshold,
|
|
1029
1114
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1115
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1030
1116
|
}),
|
|
1031
1117
|
successText: (result, args) => {
|
|
1032
1118
|
const r = result;
|
|
@@ -1050,6 +1136,7 @@ async function applyNoise(connection, snippetClient, rawArgs) {
|
|
|
1050
1136
|
distribution: args.distribution,
|
|
1051
1137
|
monochromatic: args.monochromatic,
|
|
1052
1138
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1139
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1053
1140
|
}),
|
|
1054
1141
|
successText: (result, args) => {
|
|
1055
1142
|
const r = result;
|
|
@@ -1075,6 +1162,7 @@ async function applyMotionBlur(connection, snippetClient, rawArgs) {
|
|
|
1075
1162
|
angle: args.angle,
|
|
1076
1163
|
radius: args.radius,
|
|
1077
1164
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1165
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1078
1166
|
}),
|
|
1079
1167
|
successText: (result, args) => {
|
|
1080
1168
|
const r = result;
|
|
@@ -1107,6 +1195,7 @@ async function applyLensBlur(connection, snippetClient, rawArgs) {
|
|
|
1107
1195
|
focalDistance: args.focal_distance ?? 0,
|
|
1108
1196
|
invertDepth: args.invert_depth ?? false,
|
|
1109
1197
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1198
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1110
1199
|
}),
|
|
1111
1200
|
successText: (result, args) => {
|
|
1112
1201
|
const r = result;
|
|
@@ -1141,6 +1230,7 @@ async function applySmartSharpen(connection, snippetClient, rawArgs) {
|
|
|
1141
1230
|
highlightTonalWidth: args.highlight_tonal_width ?? 50,
|
|
1142
1231
|
highlightRadius: args.highlight_radius ?? 30,
|
|
1143
1232
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1233
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1144
1234
|
}),
|
|
1145
1235
|
successText: (result, args) => {
|
|
1146
1236
|
const r = result;
|
|
@@ -1176,6 +1266,7 @@ async function applyReduceNoise(connection, snippetClient, rawArgs) {
|
|
|
1176
1266
|
blueStrength: args.blue_strength ?? 5,
|
|
1177
1267
|
bluePreserveDetails: args.blue_preserve_details ?? 50,
|
|
1178
1268
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1269
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1179
1270
|
}),
|
|
1180
1271
|
successText: (result, args) => {
|
|
1181
1272
|
const r = result;
|
|
@@ -1200,6 +1291,7 @@ async function applyHighPass(connection, snippetClient, rawArgs) {
|
|
|
1200
1291
|
params: (args) => ({
|
|
1201
1292
|
radius: args.radius,
|
|
1202
1293
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1294
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1203
1295
|
}),
|
|
1204
1296
|
successText: (result, args) => {
|
|
1205
1297
|
const r = result;
|
|
@@ -1229,6 +1321,7 @@ async function applyRadialBlur(connection, snippetClient, detClient, rawArgs) {
|
|
|
1229
1321
|
grounded = { x: Math.round(loc.geom.point.x), y: Math.round(loc.geom.point.y) };
|
|
1230
1322
|
}
|
|
1231
1323
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1324
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1232
1325
|
const script = await snippetClient.build('applyRadialBlur', {
|
|
1233
1326
|
amount,
|
|
1234
1327
|
method,
|
|
@@ -1236,6 +1329,7 @@ async function applyRadialBlur(connection, snippetClient, detClient, rawArgs) {
|
|
|
1236
1329
|
centerX,
|
|
1237
1330
|
centerY,
|
|
1238
1331
|
applyToActiveLayer,
|
|
1332
|
+
asSmartFilter,
|
|
1239
1333
|
});
|
|
1240
1334
|
const result = await runScript(connection, script);
|
|
1241
1335
|
const r = result;
|
|
@@ -1278,7 +1372,8 @@ async function applyPixelate(connection, snippetClient, rawArgs) {
|
|
|
1278
1372
|
params: (args) => {
|
|
1279
1373
|
const mode = args.mode;
|
|
1280
1374
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1281
|
-
const
|
|
1375
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1376
|
+
const params = { mode, applyToActiveLayer, asSmartFilter };
|
|
1282
1377
|
if (mode === 'mosaic' || mode === 'crystallize' || mode === 'pointillize') {
|
|
1283
1378
|
params.cellSize = args.cell_size ?? 10;
|
|
1284
1379
|
}
|
|
@@ -1311,7 +1406,8 @@ async function applyDistort(connection, snippetClient, rawArgs) {
|
|
|
1311
1406
|
params: (args) => {
|
|
1312
1407
|
const mode = args.mode;
|
|
1313
1408
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1314
|
-
const
|
|
1409
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1410
|
+
const params = { mode, applyToActiveLayer, asSmartFilter };
|
|
1315
1411
|
if (mode === 'twirl') {
|
|
1316
1412
|
params.angle = args.angle ?? 90;
|
|
1317
1413
|
}
|
|
@@ -1366,7 +1462,8 @@ async function applyStylize(connection, snippetClient, rawArgs) {
|
|
|
1366
1462
|
params: (args) => {
|
|
1367
1463
|
const mode = args.mode;
|
|
1368
1464
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1369
|
-
const
|
|
1465
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1466
|
+
const params = { mode, applyToActiveLayer, asSmartFilter };
|
|
1370
1467
|
if (mode === 'emboss') {
|
|
1371
1468
|
params.angle = args.angle ?? 135;
|
|
1372
1469
|
params.height = args.height ?? 3;
|
|
@@ -1406,7 +1503,8 @@ async function applyRender(connection, snippetClient, rawArgs) {
|
|
|
1406
1503
|
params: (args) => {
|
|
1407
1504
|
const mode = args.mode;
|
|
1408
1505
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1409
|
-
const
|
|
1506
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1507
|
+
const params = { mode, applyToActiveLayer, asSmartFilter };
|
|
1410
1508
|
if (mode === 'fibers') {
|
|
1411
1509
|
params.variance = args.variance ?? 16;
|
|
1412
1510
|
params.strength = args.fiber_strength ?? 4;
|
|
@@ -1434,7 +1532,8 @@ async function applyOther(connection, snippetClient, rawArgs) {
|
|
|
1434
1532
|
params: (args) => {
|
|
1435
1533
|
const mode = args.mode;
|
|
1436
1534
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1437
|
-
const
|
|
1535
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1536
|
+
const params = { mode, applyToActiveLayer, asSmartFilter };
|
|
1438
1537
|
if (mode === 'maximum' || mode === 'minimum') {
|
|
1439
1538
|
params.radius = args.radius ?? 3;
|
|
1440
1539
|
params.preserve = args.preserve ?? 'roundness';
|
|
@@ -1465,7 +1564,8 @@ async function applyDenoise(connection, snippetClient, rawArgs) {
|
|
|
1465
1564
|
params: (args) => {
|
|
1466
1565
|
const mode = args.mode;
|
|
1467
1566
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1468
|
-
const
|
|
1567
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1568
|
+
const params = { mode, applyToActiveLayer, asSmartFilter };
|
|
1469
1569
|
if (mode === 'median') {
|
|
1470
1570
|
params.radius = args.radius ?? 4;
|
|
1471
1571
|
}
|
|
@@ -1495,7 +1595,8 @@ async function applyBlurAdv(connection, snippetClient, rawArgs) {
|
|
|
1495
1595
|
params: (args) => {
|
|
1496
1596
|
const mode = args.mode;
|
|
1497
1597
|
const applyToActiveLayer = args.apply_to_active_layer ?? false;
|
|
1498
|
-
const
|
|
1598
|
+
const asSmartFilter = args.as_smart_filter ?? false;
|
|
1599
|
+
const params = { mode, applyToActiveLayer, asSmartFilter };
|
|
1499
1600
|
if (mode === 'surface_blur') {
|
|
1500
1601
|
params.radius = args.radius ?? 15;
|
|
1501
1602
|
params.threshold = args.threshold ?? 20;
|
|
@@ -1531,6 +1632,7 @@ async function applyOilPaint(connection, snippetClient, rawArgs) {
|
|
|
1531
1632
|
shine: args.shine ?? 1.3,
|
|
1532
1633
|
lightingOn: args.lighting_on ?? true,
|
|
1533
1634
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1635
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1534
1636
|
}),
|
|
1535
1637
|
successText: (result) => {
|
|
1536
1638
|
const r = result;
|
|
@@ -1556,6 +1658,7 @@ async function applyDisplace(connection, snippetClient, rawArgs) {
|
|
|
1556
1658
|
displacementMap: args.displacement_map ?? 'stretch_to_fit',
|
|
1557
1659
|
undefinedAreas: args.undefined_areas ?? 'repeat_edge',
|
|
1558
1660
|
applyToActiveLayer: args.apply_to_active_layer ?? false,
|
|
1661
|
+
asSmartFilter: args.as_smart_filter ?? false,
|
|
1559
1662
|
}),
|
|
1560
1663
|
successText: (result, args) => {
|
|
1561
1664
|
const r = result;
|