@ajsmonty/adobe-mcp 1.1.2 → 1.5.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/CHANGELOG.md +19 -0
- package/README.md +361 -119
- package/SECURITY.md +24 -1
- package/adapters/ae_more.mjs +208 -0
- package/adapters/an.mjs +96 -0
- package/adapters/assets.mjs +194 -0
- package/adapters/blender.mjs +230 -0
- package/adapters/id.mjs +250 -0
- package/adapters/ppro.mjs +4 -3
- package/adapters/ppro_more.mjs +393 -0
- package/adapters/ps_ai_more.mjs +277 -0
- package/adapters/substance.mjs +193 -0
- package/adapters/texlib.mjs +193 -0
- package/bridges/blender/adobe_mcp_bridge.py +132 -0
- package/cep/mcp-bridge/CSXS/manifest.xml +36 -2
- package/cep/mcp-bridge/main.js +48 -20
- package/cli/doctor.mjs +234 -0
- package/cli/index.mjs +67 -0
- package/cli/install.mjs +149 -0
- package/core/barrows.mjs +16 -0
- package/core/blender_pbr.py +148 -0
- package/core/bridge.mjs +166 -77
- package/core/harness.jsx +11 -6
- package/core/harness.py +34 -0
- package/core/helpers.mjs +196 -0
- package/core/platform.mjs +209 -0
- package/core/pybridge.mjs +256 -0
- package/core/telemetry.mjs +80 -0
- package/core/texlib.mjs +279 -0
- package/core/win/run_com.js +33 -0
- package/core/workspace.mjs +1 -1
- package/knowledge/knowledge.mjs +8 -5
- package/knowledge/lessons.jsonl +19 -0
- package/package.json +56 -3
- package/scripts/ae/Cinematic_3D_Composite.jsx +173 -0
- package/scripts/blender/Creature_Walk_Cinematic.py +569 -0
- package/scripts/substance/Creature_Skin_LookDev.py +148 -0
- package/server.mjs +92 -27
- package/workflow/setup.mjs +106 -0
- package/workflow/vfx.mjs +136 -0
- package/workflow/workflow.mjs +66 -21
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Cinematic_3D_Composite — lands a Blender CG render on a live-action plate in the active comp.
|
|
3
|
+
Imports the beauty / shadow / mist PNG sequences from PARAMS.render_dir (the folders written by
|
|
4
|
+
scripts/blender/Creature_Walk_Cinematic.py) or uses existing layers named Dino_Render_Beauty,
|
|
5
|
+
Dino_Shadow, Dino_Mist and BG_Plate. Builds: multiplied shadow-catcher pass, a precomped edge
|
|
6
|
+
light wrap (blurred plate inside the CG's inner edge, screened), depth haze from the mist pass,
|
|
7
|
+
an optional depth lens blur, a 0.5 px CG softening, and plate-matched grain on the CG only.
|
|
8
|
+
Motion blur is NOT added here: the 180-degree shutter is already baked into the render.
|
|
9
|
+
PARAMS keys: render_dir, fps (24), wrap_px (18), wrap_opacity (55), shadow_opacity (85),
|
|
10
|
+
haze_color ([0.62,0.68,0.74]), haze_amount (35), lens_blur_radius (0), focus_value (0.1).
|
|
11
|
+
*/
|
|
12
|
+
(function () {
|
|
13
|
+
var P = (typeof $.global.PARAMS === "object" && $.global.PARAMS) ? $.global.PARAMS : {};
|
|
14
|
+
function opt(k, d) { return (P[k] === undefined || P[k] === null) ? d : P[k]; }
|
|
15
|
+
var report = { steps: [] };
|
|
16
|
+
function note(s) { report.steps.push(s); }
|
|
17
|
+
|
|
18
|
+
function findProp(group, name) {
|
|
19
|
+
for (var i = 1; i <= group.numProperties; i++) {
|
|
20
|
+
var p = group.property(i);
|
|
21
|
+
if (p.name === name || p.matchName === name) return p;
|
|
22
|
+
if (p.propertyType !== PropertyType.PROPERTY) {
|
|
23
|
+
var hit = findProp(p, name);
|
|
24
|
+
if (hit) return hit;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
function setP(effect, name, value) {
|
|
30
|
+
var p = findProp(effect, name);
|
|
31
|
+
if (p) { p.setValue(value); return true; }
|
|
32
|
+
note("param '" + name + "' not found on " + effect.name);
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
// Layer-reference params store an index; set them only after the stack stops changing.
|
|
36
|
+
var layerRefs = [];
|
|
37
|
+
function setLayerRef(effect, name, layer) { layerRefs.push({ effect: effect, name: name, layer: layer }); }
|
|
38
|
+
function layerNamed(comp, name) {
|
|
39
|
+
for (var i = 1; i <= comp.numLayers; i++) if (comp.layer(i).name === name) return comp.layer(i);
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
function firstPng(folder) {
|
|
43
|
+
var f = new Folder(folder);
|
|
44
|
+
if (!f.exists) return null;
|
|
45
|
+
var all = f.getFiles("*.png"), files = [];
|
|
46
|
+
for (var i = 0; i < all.length; i++) if (/\d+\.png$/i.test(all[i].name)) files.push(all[i]);
|
|
47
|
+
if (!files.length) return null;
|
|
48
|
+
files.sort(function (a, b) { return a.name < b.name ? -1 : 1; });
|
|
49
|
+
return files[0];
|
|
50
|
+
}
|
|
51
|
+
function importSeq(folder, name, fps) {
|
|
52
|
+
var first = firstPng(folder);
|
|
53
|
+
if (!first) return null;
|
|
54
|
+
var io = new ImportOptions(first);
|
|
55
|
+
io.sequence = true;
|
|
56
|
+
var item = app.project.importFile(io);
|
|
57
|
+
item.mainSource.conformFrameRate = fps;
|
|
58
|
+
item.name = name;
|
|
59
|
+
return item;
|
|
60
|
+
}
|
|
61
|
+
function matteTo(layer, matte, type) {
|
|
62
|
+
if (typeof layer.setTrackMatte === "function") layer.setTrackMatte(matte, type); // AE 23+
|
|
63
|
+
else { matte.moveBefore(layer); layer.trackMatteType = type; }
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
app.beginUndoGroup("Cinematic 3D Composite");
|
|
67
|
+
var fps = opt("fps", 24);
|
|
68
|
+
var comp = app.project.activeItem;
|
|
69
|
+
var dir = opt("render_dir", null);
|
|
70
|
+
var items = {};
|
|
71
|
+
if (dir) {
|
|
72
|
+
items.beauty = importSeq(dir + "/beauty", "Dino_Render_Beauty", fps);
|
|
73
|
+
items.shadow = importSeq(dir + "/shadow", "Dino_Shadow", fps);
|
|
74
|
+
items.mist = importSeq(dir + "/mist", "Dino_Mist", fps);
|
|
75
|
+
if (!items.beauty) throw new Error("No beauty PNG sequence in " + dir + "/beauty");
|
|
76
|
+
note("imported sequences from " + dir);
|
|
77
|
+
}
|
|
78
|
+
if (!(comp instanceof CompItem)) {
|
|
79
|
+
if (!items.beauty) throw new Error("Open a composition first (or pass PARAMS.render_dir).");
|
|
80
|
+
comp = app.project.items.addComp("Dino_Shot", items.beauty.width, items.beauty.height, 1,
|
|
81
|
+
items.beauty.duration, fps);
|
|
82
|
+
comp.openInViewer();
|
|
83
|
+
note("created comp Dino_Shot");
|
|
84
|
+
}
|
|
85
|
+
var beauty = layerNamed(comp, "Dino_Render_Beauty") || (items.beauty ? comp.layers.add(items.beauty) : null);
|
|
86
|
+
if (!beauty) throw new Error("No layer named Dino_Render_Beauty in comp " + comp.name);
|
|
87
|
+
beauty.name = "Dino_Render_Beauty";
|
|
88
|
+
var shadow = layerNamed(comp, "Dino_Shadow") || (items.shadow ? comp.layers.add(items.shadow) : null);
|
|
89
|
+
var mist = layerNamed(comp, "Dino_Mist") || (items.mist ? comp.layers.add(items.mist) : null);
|
|
90
|
+
var plate = layerNamed(comp, "BG_Plate");
|
|
91
|
+
if (!plate) note("no BG_Plate layer: light wrap and grain matching need one (name your plate BG_Plate)");
|
|
92
|
+
|
|
93
|
+
// Stack order (top -> bottom): light wrap, haze, beauty, shadow, plate
|
|
94
|
+
if (plate) plate.moveToEnd();
|
|
95
|
+
if (shadow) {
|
|
96
|
+
if (plate) shadow.moveBefore(plate); else shadow.moveToEnd();
|
|
97
|
+
shadow.name = "Dino_Shadow";
|
|
98
|
+
shadow.blendingMode = BlendingMode.MULTIPLY; // shadow catcher: white = no shadow
|
|
99
|
+
shadow.opacity.setValue(opt("shadow_opacity", 85));
|
|
100
|
+
note("shadow pass multiplied at " + opt("shadow_opacity", 85) + "%");
|
|
101
|
+
}
|
|
102
|
+
beauty.moveToBeginning();
|
|
103
|
+
|
|
104
|
+
// CG is sharper than any real lens: soften by half a pixel before grain
|
|
105
|
+
var soft = beauty.Effects.addProperty("ADBE Gaussian Blur 2");
|
|
106
|
+
soft.name = "CG Softening";
|
|
107
|
+
setP(soft, "Blurriness", 0.5);
|
|
108
|
+
|
|
109
|
+
var lensR = opt("lens_blur_radius", 0);
|
|
110
|
+
if (mist && lensR > 0) {
|
|
111
|
+
var lb = beauty.Effects.addProperty("ADBE Camera Lens Blur");
|
|
112
|
+
setP(lb, "Blur Radius", lensR);
|
|
113
|
+
setLayerRef(lb, "Layer", mist);
|
|
114
|
+
setP(lb, "Blur Focal Distance", Math.round(255 * opt("focus_value", 0.1)));
|
|
115
|
+
note("depth lens blur r=" + lensR + " from mist pass");
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (mist) {
|
|
119
|
+
mist.name = "Dino_Mist";
|
|
120
|
+
// Atmospheric perspective: haze colour, matted by depth, clipped to the CG
|
|
121
|
+
var hazeSolid = comp.layers.addSolid(opt("haze_color", [0.62, 0.68, 0.74]), "Dino_Haze",
|
|
122
|
+
comp.width, comp.height, comp.pixelAspect, comp.duration);
|
|
123
|
+
hazeSolid.moveBefore(beauty);
|
|
124
|
+
var hazeMatte = comp.layers.add(mist.source);
|
|
125
|
+
hazeMatte.name = "Dino_Haze_Matte";
|
|
126
|
+
hazeMatte.moveBefore(hazeSolid);
|
|
127
|
+
matteTo(hazeSolid, hazeMatte, TrackMatteType.LUMA);
|
|
128
|
+
hazeSolid.opacity.setValue(opt("haze_amount", 35));
|
|
129
|
+
// keep the haze on the CG only
|
|
130
|
+
var hazeClip = hazeSolid.Effects.addProperty("ADBE Set Matte3");
|
|
131
|
+
setLayerRef(hazeClip, "Take Matte From Layer", beauty);
|
|
132
|
+
mist.enabled = false;
|
|
133
|
+
note("depth haze " + opt("haze_amount", 35) + "% from mist pass");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (plate) {
|
|
137
|
+
// Light wrap precomp: blurred plate, visible only in the CG's inner edge
|
|
138
|
+
var lw = app.project.items.addComp("Dino_LightWrap", comp.width, comp.height, comp.pixelAspect,
|
|
139
|
+
comp.duration, comp.frameRate);
|
|
140
|
+
var base = lw.layers.add(beauty.source);
|
|
141
|
+
var fill = base.Effects.addProperty("ADBE Fill");
|
|
142
|
+
setP(fill, "Color", [0, 0, 0]);
|
|
143
|
+
var wrapPlate = lw.layers.add(plate.source);
|
|
144
|
+
var pb = wrapPlate.Effects.addProperty("ADBE Gaussian Blur 2");
|
|
145
|
+
setP(pb, "Blurriness", 60);
|
|
146
|
+
setP(pb, "Repeat Edge Pixels", 1);
|
|
147
|
+
wrapPlate.preserveTransparency = true; // only over the CG
|
|
148
|
+
var edge = lw.layers.add(beauty.source);
|
|
149
|
+
var eb = edge.Effects.addProperty("ADBE Gaussian Blur 2");
|
|
150
|
+
setP(eb, "Blurriness", opt("wrap_px", 18));
|
|
151
|
+
matteTo(wrapPlate, edge, TrackMatteType.ALPHA_INVERTED); // inner edge only
|
|
152
|
+
var wrapLayer = comp.layers.add(lw);
|
|
153
|
+
wrapLayer.moveToBeginning();
|
|
154
|
+
wrapLayer.blendingMode = BlendingMode.SCREEN;
|
|
155
|
+
wrapLayer.opacity.setValue(opt("wrap_opacity", 55));
|
|
156
|
+
note("light wrap precomp (" + opt("wrap_px", 18) + " px edge, screen " + opt("wrap_opacity", 55) + "%)");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
for (var r = 0; r < layerRefs.length; r++) setP(layerRefs[r].effect, layerRefs[r].name, layerRefs[r].layer.index);
|
|
160
|
+
|
|
161
|
+
// Grain on the CG only (the plate already has its own)
|
|
162
|
+
var grain = beauty.Effects.addProperty("ADBE Add Grain");
|
|
163
|
+
setP(grain, "Viewing Mode", 3); // Final Output (default is a preview box)
|
|
164
|
+
setP(grain, "Intensity", 0.35);
|
|
165
|
+
setP(grain, "Size", 0.9);
|
|
166
|
+
note("grain on CG (Add Grain, Final Output)");
|
|
167
|
+
|
|
168
|
+
app.endUndoGroup();
|
|
169
|
+
report.comp = comp.name;
|
|
170
|
+
report.layers = [];
|
|
171
|
+
for (var i = 1; i <= comp.numLayers; i++) report.layers.push(comp.layer(i).name);
|
|
172
|
+
$.global.MCP_RESULT = report;
|
|
173
|
+
})();
|